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 / gaurav
#include <stdio.h>
#include <conio.h>
struct student
{
char name[20],dept[20],course[20];
int roll, year_join;
}stud[450];
void main ()
{
int i,n;
printf("Enter the number of student(s)");
scanf("%d",&n);
printf("Enter the record of student(s)
");
for(i=0;i<n;i++)
{
printf("Enter name");
scanf("%s",&stud[i].name);
printf("Enter Department");
scanf("%s",&stud[i].dept);
printf("Enter Roll no");
scanf("%d",&stud[i].roll);
printf("Enter year of joining");
scanf("%d", &stud[i].year_join);
printf("Enter course");
scanf("%s",&stud[i].course);
}
printf("Data of students are");
for(i=0;i<n;i++)
{
printf("Name of student is %s ",stud[i].name);
printf("Departemt of student is %s ",stud[i].dept);
printf("Roll no of student is %d ",stud[i].roll);
printf("Year of joining is %d ",stud[i].year_join);
printf("Course of student is %s ",stud[i].course);
}
getch();
}
| Is This Answer Correct ? | 7 Yes | 8 No |
Post New Answer View All Answers
What does c mean in standard form?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
What are extern variables in c?
What are header files in c programming?
Explain the concept and use of type void.
Explain enumerated types.
What is the difference between formatted&unformatted i/o functions?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
What is "Duff's Device"?
Explain the difference between #include "..." And #include <...> In c?
Does c have function or method?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
Write a program of advanced Fibonacci series.
What are keywords c?