Sunday, 15 September 2013

Input & Output in C++

#include<iostream>
using namespace std;

void main()
{
 int input;
 cout<<"enter a number :";
 cin>>input;
 cout<<"input is = "<< input<<endl;
 system("pause");
  
}

Hello World in C++

#include<iostream>
using namespace std;

void main()
{
 cout<<"hello world\n";
 system("pause");
}

First Program in C , Hello World

#include<stdio.h>
#include<stdlib.h>

void main()
{
 printf("Hello World!\n");
 system("pause");
}