-->

program to understand typedef

using codeblocks
------------------------------------------------------------------------------------------
//understanding typedef
#include <stdio.h>
int main()
{
    typedef int second_type;// creates another data type named second_type. It gets all property of 'int'
    second_type a,b,c;      // second_type is working as integer data type.
    printf("enter a,b,and c\n");
    scanf("%d%d%d",&a,&b,&c);  //gets input
    printf("a=%d,b=%d and c=%d",a,b,c);//prints output
    return 0;
}

------------------------------------------------------------------------------------------
using turboc++
------------------------------------------------------------------------------------------

//understanding typedef
#include <stdio.h>
#include<conio.h>
int main()
{
    typedef int second_type;// creates another data type named second_type. It gets all property of 'int'
    second_type a,b,c;      // second_type is working as integer data type.
    printf("enter a,b,and c\n");
    scanf("%d%d%d",&a,&b,&c);  //gets input
    printf("a=%d,b=%d and c=%d",a,b,c);//prints output
   getch(); 
  return 0;
}

No comments:

Post a Comment