In this tutorial, we have to discuss about some programs that are so easy.
We discuss two programs which are given below.
Write a program to that input name, age, and address from the user and then display their value on the screen.
String Program
#include<iostream>
using namespace std;
int main(){
char name[30],add[30];
int age;
cout<<“Please Enter The name:”;
cin>>name;
cout<<“Please Enter The Address:”;
cin>>add;
cout<<“Please Enter The age:”;
cin>>age;
cout<<“Your name is :”<<name<<endl;
cout<<“Your address is :”<<add<<endl;
cout<<“Your age is :”<<age<<endl;
}
And other program is given below.
Write a program that inputs a character and display its ASCII Code.
ASCII CODE
#include<iostream>
using namespace std;
int main(){
char chr;
cout<<"Please Enter the Character:";
cin>>chr;
int num=chr;
cout<<"ASCII CODE of "<<chr<<" is :"<<num;
}
Must watch the video for practical
Thanks for Visiting