C++ Programming

C++ Program to take input name, class, and roll number from user and display

Write a program in c++ that can ask for name, class and roll number  and display as Hello Your class is and your roll number is

C Code

#include<iostream.h>
#include<conio.h>
void main()
{
char name[20];
char clas[6];
int roll;

cout<<"nEnter Name:";
cin>>name;
cout<<"nEnter Class:";
cin>>clas;
cout<<"nEnter Rollnumber:";
cin>>roll;

cout<<"nHello!!t"<<name<<"nYour class ist"<<clas<<"nYour rollnumber ist"<<roll;

cout<<"nThank you";

cout<<"nPress any key to continue…";

getch();

}

Output

Related Articles

Back to top button

Adblock Detected

Please turn off your Adblocker to view your content.