Write a program to input an integer from the keyboard and display on the screen “WELL DONE” that many times.



Write a program to input an integer from the keyboard and display on the screen “WELL DONE&rdq..

Answer / hr

#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
char *str;
str="WELL DONE";
cout<<" Enter an integer value ";
cin>>n;
for(int i=0;i<n;i++)
{
cout<<str<<endl;
}
return 0;
}
OUTPUT:
Enter an integer value 5
WELL DONE
WELL DONE
WELL DONE
WELL DONE
WELL DONE

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C++ Interview Questions

Name the operators that cannot be overloaded.

1 Answers   Wipro,


It is possible to build a C++ compiler on top of a C compiler. How would you do this?

0 Answers   Amazon,


Write a program to read the values a, b and c and display x, where x=a/b–c. Test the program for the following values: (a) a = 250, b = 85, c = 25 (b) a = 300, b = 70, c = 70

1 Answers  


Tell How To Check Whether A Linked List Is Circular ?

1 Answers   IBS, Infosys,


Write a C++ Program to Display Number (Entered by the User).

1 Answers  






What does malloc return in C and C++?

0 Answers   Alter,


When must you use a constructor initializer list?

0 Answers   Amazon,


Question on Copy constructor.

0 Answers   Alter,


Can we call a virtual function from a constructor?

1 Answers  


Can we use THIS Pointer in static function – Reason in C++?

0 Answers  


Find the Factorial of a number using a program.

0 Answers   Accenture,


What is latest update of C++ ?

0 Answers   Adobe,


Categories