Search This Blog

Saturday, 1 March 2014

typedef in C++

/*
typedef changes the name of the  variable such that no confusion is created .
Syntax :  typedef int Integer;
              Integer a,b;
              // here a and b are two integer values .
*/


#include<iostream.h>
#include<conio.h>
 void main()
 {
    typedef int var;
    var a,b,c;
    cout<<"Values for a and b :";
    cin>>a>>b;
    c=a+b;
    cout<<"Sum is:"<<c;
    getch();
 }

Output


No comments:

Popular Posts