Write a C++ Program to Display Number (Entered by the User).
Solution:
/* C++ Program to Display Number (Entered by the User) */
#include <iostream>
using namespace std;
int main()
{
int number;
cout << "Enter an integer :: ";
cin >> number;
cout << "
The Number entered is :: " << number<<"
";
return 0;
}
Output:
/* C++ Program to Display Number (Entered by the User) */
Enter an integer :: 8
The Number entered is :: 8
Process returned 0
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a COPY CONSTRUCTOR and when is it called?
Explain why C++ is not purely Object Oriented Language
What are the advantages/disadvantages of using inline and const?
What is the difference between malloc, calloc and realloc?
Identify the errors in the following program. #include <iostream> using namespace std; void main() { int i=5; while(i) { switch(i) { default: case 4: case 5: break; case 1: continue; case 2: case 3: break; } i-; } }
What are the advantages/disadvantages of using #define?
What are pass by value and pass by reference?what is the disadvantage of pass by value?
Explain what happens when an exception is thrown in C++.
What are Agilent PRECOMPILERS?
When would you use a pointer? A reference?
Write a C++ Program to Reverse a Number using while loop.
Discuss the role of C++ shorthands.