DO NOT MISS

Ads

Wednesday, 14 December 2016

C-Programs Using Typedef


It is a key word which is used to provide allias name to the predefined data type.

Syntax :-
typedef Data type identifiar;

Ex:-
Typedef int Prasad;


Example:-


#include<stdio.h> 
#include<conio.h> 
void main() 

    { 

           typedef int a; 
           typedef float b; 
           typedef char c; 

           a i; 
           b j; 
           c k; 

           clrscr(); 

           printf("enter a int value:"); 
           scanf("%d",&i); 

           printf("enter a float value:"); 
           scanf("%f",&j); 

           printf("enter a char value:"); 
           scanf("%s",&k); 

           printf("the int value is:=%d",i); 
           printf("\nthe float value is:=%f",j); 
           printf("\nthe char value is:=%c",k); 

           getch(); 

    }

Output:-

---------------------------------------------------------------------------------------------------------------
>> Back to Notes of C-Language (Topic Wise)
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------

Greataims

 
Copyright © 2016 Computersadda. Designed by @ Computersadda Team - Published By Greataims