P188. Program to scan data at run time using structure variable.

 #include<stdio.h>

struct one

{

        int i;

        char ch;

        float f;

};

 

void main()

{

 

        struct one v;

        printf("Enter Integer value :");

        scanf("%d",&v.i);

 

        printf("Enter Character value :");

        scanf(" %c",&v.ch);

 

        printf("Enter Float value :");

        scanf("%f",&v.f);

 

        printf("%d %c %f\n",v.i,v.ch,v.f);

}

Comments