C++ programs
- 1. Simple standardprograms
Example
Write a program that inputsname ,age ,andaddressfromthe user andthendisplaysthese valuesonthe screen.
#include<iostream>
Usingnamespace std;
Voidmain()
{
Char name[25],city[30];
Int age;
Cout<<”enteryourname:”;
Cin>>char;
Cout<<”enteryourage”;
Cin>>age;
Cout<<”enteryourcity”;
Cin>>city;
Cout<<”yourcity is:”<<city;
Cout<<”yourage is:”<<age;
Cout<<”yourname is:”<<nam;
}