C Programming Structure Examples in C

C Programming Structure Examples in C

#include<stdio.h>

struct student{
int roll;
char name[10];
} st={1360,"Banwari"};

main()
{

struct student st1;

printf("Name is %s\n",st.name);
printf("Roll no. is %d\n",st.roll);


printf("Enter second student roll no:\n");
scanf("%d",&st1.roll);

printf("Enter second student roll no:\n");
scanf("%s",&st1.name);

printf("Second student roll no:%d\n",st1.roll);

printf("Second student name:%s\n",st1.name);

}

Related Posts