171k views
0 votes
Write a loop to output the word EXAM 99 times

User Kunga
by
7.7k points

1 Answer

5 votes

Answer:

Following are the answer for the given question

for(int i=1;i<=99;++i) // for loop

{

cout<<"EXAM"<<endl; // display the word EXAM

}

Step-by-step explanation:

In this question we using for loop which is iterating 99 times and print the

word "EXAM " 99 times.

The variable i is initialized by 1 and check the condition if the condition in loop is true it will execute the loop and print "EXAM" .The loop will executed 99 times when the condition in loop is false then loop become terminated.

Following are the program in c++

#include<iostream>// header file

using namespace std;

int main() // main method

{

for(int i=1;i<=99;++i) // for loop

{

cout<<"EXAM"<<endl; // display the word EXAM

}

return 0;

}

User Duber
by
8.2k points