TYPEDEF IN C PROGRAMMING.

 #include<stdio.h>


typedef struct student
{
    int id;
    int marks;
    char fav_char;
    char name[34];
} std;
    int main()
    {
        // struct student s1, s2;
        std s1, s2;
        s1.id = 34;
        s2.id = 89;
         printf(" Value of s1's id is %d\n", s1.id);
          printf("Value of s2.s id is %d\n", s2.id);
    // typedef <previous_name> <alias_name>;
    // typedef unsigned long ul;
    // typedef int integer;
    // ul l1, l2, l3;
    // integer a=4;
    // printf("%d", a);

    return 0;
    }

OUTPUT:
Value of s1's id is 34
Value of s2.s id is 89

Comments

Post a Comment

Popular posts from this blog

C Program using continue statement

C program of WHILE Loop

NULL Pointer in C.

C Program using DO WHILE loop

C Program using SWITCH statement

New Animated Login or signup page made by HTML, CSS and JavaScript.

C Program to print multiplication table of any number.

C Language Travel Agency Manager Exercise.

STRUCTURE IN C PROGRAMMING.