Posts

Showing posts from May, 2017

Declare signed and unsigned integer

Image
Program Code #include <iostream> using namespace std; int main() { cout<<"INPUT"<<endl; int unsigned a; int signed b; cin>>a; cin>>b; cout<<"OUTPUT"<<endl; cout<<a<<endl; cout<<b; } Output

Make a program that take three integers and show the result in the ascending Order.

Image
PROGRAM CODE #include <iostream> using namespace std; int main() {  int a,b,c;  cout<<"Enter first Integer: ";  cin>>a;  cout<<"Enter Second Integer: ";  cin>>b;  cout<<"Enter Third Integer: ";  cin>>c;  if ((a>b)&&(b>c))  {  cout<<"The Ascedning order is"<<endl;  cout<<c<<endl;  cout<<b<<endl;  cout<<a<<endl;}  else if ((a<b)&&(b>c)&&(a>c))     {      cout<<"The Ascending order is"<<endl;      cout<<c<<endl;      cout<<a<<endl;      cout<<b<<endl;     }  else if ((a<b)&&(b<c))  {  cout<<"The Ascending order is "<<endl;  cout<<a<<endl;  cout<<b<<endl;  cou...