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
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
What is the process of writing the null pointer?
What is the difference between ++a and a++?
Where static variables are stored in memory in c?
What is the importance of c in your views?
Is c call by value?
Why c is a procedural language?
How can I change their mode to binary?
Why isn't it being handled properly?
what is a constant pointer in C
How would you rename a function in C?
What do you mean by invalid pointer arithmetic?
Write a program to identify if a given binary tree is balanced or not.
What is keyword in c?
which type of aspect you want from the student.