C Program To Print The ID And Name Of Each Student Using Struct #1
♣ Try it Out ::
#include<stdio.h>
#include<conio.h>
struct student
{
int id;
char name[25];
};
int main()
{
struct student x;
printf("Enter id & name for one student: \n");
scanf("%d", &x.id);
scanf("%s", x.name);
printf("\nStudent id\t: %d \n", x.id);
printf("Student name\t: %s \n", x.name);
getch();
return(0);
}
♣ Output ::
Enter id & name for one student: 1002020001 Muhit Student id : 1002020001 Student name : Muhit
♣ Downloads ::
Comments
Post a Comment