You Are 10 Years Old. You Are Too Young To Play The Game.: #Include
You Are 10 Years Old. You Are Too Young To Play The Game.: #Include
*****
*****
*****
*****
*****
cout<<"*****"<<endl;
cout<<"*****"<<endl;
cout<<"*****"<<endl;
cout<<"*****"<<endl;
cout<<"*****"<<endl;
Exercise 3: Write a C++ program to declare two integer , one float
variables and assign 10, 15, and 12.6 to them respectively. It then prints
these values on the screen. #include <iostream>
using namespace std;
int main ( )
{
int a = 10, b = 15;
float c = 12.6;
cout<<a<<endl<<b<<endl<<c<<endl;
return 0;
}
Exercise 4: Write a C++ program to prompt the user to input her/his name
and print this name on the screen, as shown below. The text from
keyboard can be read by using cin>> and to display the text on the screen
you can use cout<<.
Hello Sok! .
#include <iostream>
using namespace std;
int main ( )
{
string name;
cout<<"Enter your name: ";
cin>>name;
cout<<"Hello "<<name<<"!"<<endl;
return 0;
#include <iostream>
using namespace std;
int main ( )
{
int num1 , num2 , num3;
cout<<"Please enter your 3 numbers: ";
cin>>num1>>num2>>num3;
cout<<"Your numbers forward: "<<endl;
cout<<num1<<endl<<num2<<endl<<num3<<endl;
cout<<"\nYour numbers reversed: "<<endl;
cout<<num3<<endl<<num2<<endl<<num1<<endl;
return 0;
}