C++ Syntax Question:
Download Job Interview Questions and Answers PDF
How to demonstrate the use of a variable?
Answer:
Here is a sample program demonstrating the use of a variable:
#include <iostream>
using namespace std;
int main()
{
int thisisanumber;
cout<<"Please enter a number: ";
cin>> thisisanumber;
cin.ignore();
cout<<"You entered: "<< thisisanumber <<"n";
cin.get();
}</iostream>
#include <iostream>
using namespace std;
int main()
{
int thisisanumber;
cout<<"Please enter a number: ";
cin>> thisisanumber;
cin.ignore();
cout<<"You entered: "<< thisisanumber <<"n";
cin.get();
}</iostream>
Download Basic C++ Syntax Interview Questions And Answers
PDF
Previous Question | Next Question |
How to Declaring Variables in C++? | What relational operators if statements in C++? |