Q-1: Create a structure to specify data on students given
below:
Roll number, Name, Department, Course, Year of joining
Assume that there are not more than 450 students in the
college.

Answer Posted / prathmesh dewade

#include<stdio.h>
struct stud{
int roll;
char name[50];
int dep;
char c[50];
int year;

};
main()
{
struct stud st[5];
int i;
for(i=0;i<5;i++)
{
printf("
enter student record %d
",i+1);
printf("enter Roll no
");
scanf("%d",&st[i].roll);

printf("enter Name ");
scanf(" %s",&st[i].name);

printf("
enter department ");
scanf("%d",&st[i].dep);

printf("
enter Course ");
scanf(" %s",&st[i].c);

printf("
enter Year of joining");
scanf(" %d",&st[i].year);
}
for(int i=0;i<5;i++)
{
printf("Roll:%d, Name:%s, DepNo:%d,Course:%s, YearOfJoin:%d
",st[i].roll,st[i].name,st[i].dep,st[i].c,st[i].year);
}

}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record

4974


What is the process of writing the null pointer?

784


What is the difference between ++a and a++?

936


Where static variables are stored in memory in c?

722


What is the importance of c in your views?

805


Is c call by value?

800


Why c is a procedural language?

803


How can I change their mode to binary?

895


Why isn't it being handled properly?

831


what is a constant pointer in C

880


How would you rename a function in C?

807


What do you mean by invalid pointer arithmetic?

825


Write a program to identify if a given binary tree is balanced or not.

908


What is keyword in c?

789


which type of aspect you want from the student.

1901