C++ Programs


Write and run a program to print your first name on the first line, your middle name on the second line and
your last name on the third line using only cout statement.

#include"stdafx.h"
#include<iostream>
usingnamespace std;
int main()
{
cout<<"  Faraz\n";
cout<<" Ihsan\n";
cout<<" Ellahi\n";
cout<<endl;
system("pause");
return 0;
}


 Write and run a program to print following shape on screen using cout statement
#include"stdafx.h"
#include<iostream>
usingnamespace std;
int main()
{
cout<<"  /\\"<< endl;
cout<<"    /  \\"<< endl;
cout<<" /  \\"<< endl;
cout<<"  /      \\"<< endl;
cout<<" /        \\"<< endl;
cout<<"/..........\\"<< endl;
cout<<endl;
system("pause");
return 0;
}






No comments:

Post a Comment