Program to Illustrate use of Structure

#include<stdio.h>
#include<conio.h>
struct stu
{
int roll;
char name[50];
}k;
void main()
{
clrscr();
printf("\nEnter No.");
scanf("%d",&k.roll);
printf("\nEnter Name.");
scanf("%s",&k.name);
printf("\n roll no.= %d",k.roll);
printf("\n Name= %s",k.name);
getch();
}

Leave a Reply