UNDERSTANDING OF COUT COMMAND
WRITE A PROGRAMME THAT DISPLAYS YOUR NAME
CODE for C++
#include<iostream.h>
void main()
{
cout<<"my name is umair iqbal"<<endl;
}
OUTPUT
DIFFERENT DATA TYPES
WRITE A PROGRAMME THAT DISPLAYS DIFFERENT DATA TYPES USED IN OOP
CODE for C++
#include<iostream.h>
void main()
{
int x=3;
float y=2.34;
char a='w';
cout<<"integer value is"<<endl<<x<<endl;
cout<<"float value is"<<endl<<y<<endl;
cout<<"character value is"<<endl<<a<<endl;
}
OUTPUT
UNDERSTANDING WITH endl AND "\n" COMMAND
WRITE A PROGRAMME THAT USES BOTH endl AND "\n" COMMANDS
CODE for C++
#include<iostream.h>
void main()
{
cout<<"i am student of 7th semester\n";
cout<<"my name is umair"<<endl;
}
OUTPUT
UNDERSTANDING WITH CIN COMMAND
WRITE A PROGRAMME THAT TAKES DATA FROM USER AND THAN DISPLAY IT
CODE for C++
#include<iostream.h>
void main()
{
int x;
cout<<"enter data"<<endl;
cin>>x;
cout<<"data is ="<<x<<endl;
}
OUTPUT
0 comments:
Post a Comment