Write a program to initialize the structure

//this is a program to initialize the structure
#include<stdio.h>
#include<conio.h>
void main()
{
struct student
{
char name[20];
int rollno;
float per;
};

struct student s={"Pratik",136,84.07};

printf("\n\nName=%s\n\nRoll No.=%d\n\nPercentage=%f",s.name,s.rollno,s.per);

getch();
}

Previous
Next Post »