write a program to assign values to different variables at the time of declaration.print the assigned values on the computer screen.
#include<iostream>
using namespace std;
main()
{
int xy=1,z=1995;
float ab=3.8;
char name[15]="MOMINA ELAHI";
cout<<name<<endl;
cout<<xy<<endl;
cout<<z<<endl;
cout<<ab<<endl;
}
Output of the above program
MOMINA ELAHI
1
1995
3.8
#include<iostream>
using namespace std;
main()
{
int xy=1,z=1995;
float ab=3.8;
char name[15]="MOMINA ELAHI";
cout<<name<<endl;
cout<<xy<<endl;
cout<<z<<endl;
cout<<ab<<endl;
}
Output of the above program
MOMINA ELAHI
1
1995
3.8
Comments
Post a Comment