Thursday, June 22, 2017

Using int in C++ Program

Example of using integer variables in C++ programs.

#include<iostream>
using namespace std;

int main()
{
int rollno;
cout<<"What is your Roll Number? ";
cin>>rollno;
cout<<"Your Roll Number is "<<rollno;
return 0;
}

Output of Program

What is your Roll Number? 101
Your Roll Number is 101

No comments:

Post a Comment