7. Determine the output of each of the following programs when it is executed. (a)
#include using namespace std; int main()
{
bool flag = true;
for (int i = 0; flag; ++i)
}
(b)
cout <><><“\n”;>
#include using namespace std; int main()
{
}
(c)
for (int i = 0; false; ++i) cout <>
return 0;
#include using namespace std; int main()
{
}
(d)
int i = 0; for (;;);
cout <> 0;
#include using namespace std; int main()
{
}
(e)
int i = 0;
for (true; ++i; false)
cout <><><“\n”;>
#include using namespace std; int main()
{
}
(f)
for (float a = -1.1; true; a = a+0.5) cout <><>
return 0;
#include using namespace std; int main()
{
}
(g)
for (char ch = ‘A’; ch <=><><>
return 0;
#include using namespace std; int main()
{
}
(h)
for (int i = 0;;)
cout <><><“\n”;>
#include using namespace std; int main()
{
for (int i = 0;;)
cout <><><“\n”;>
}
“\n”;>“\n”;>=>“\n”;>“\n”;>