Wednesday, 15 May 2013

A simple "Hello World" program

#include<iostream.h>  //Header file
#include<conio.h>
void main()                // main function
{
cout<<"Hello World";
getch();
}



See also:
Find average of two numbers


                                          

Swapping value of two variables without third variable


#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
cout<<"enter the value of a";
cin>>a;
cout<<"\n Enter b";
cin>>b;  
a=a+b;  
b=a+b;  

a=b-a;    
b=-1*(a-b)-a;

cout<<"\n a is"<<a;
cout<<"\n b is"<<b;
getch();
}

full details in json
Proudly Powered by Blogger.
back to top