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 / abuubkar
#include <stdio.h>
#include <string.h>
struct student
{
int roll;
char name[50];
char dept[50];
int course;
int yoj;
};
main()
{
struct student std[5];
int i;
for (i=0;i<2;i++)
{
printf("enter roll of student %d
",i+1);
scanf("%d",&std[i].roll);
printf("enter name of student %d
",i+1);
scanf("%s",&std[i].name);
printf("enter department of student %d
",i+1);
scanf("%s",&std[i].dept);
printf("enter couse of student %d
",i+1);
scanf("%d",&std[i].course);
printf("enter year of join of the student %d
",i+1);
scanf("%d",&std[i].yoj);
}
for (i=0;i<2;i++)
{
printf("The information of student %d is
",i+1);
printf("%d
%s
%s
%d
%d",std[i].roll,std[i].name,std[i].dept,std[i].course,std[i].yoj);
}
}
| Is This Answer Correct ? | 2 Yes | 6 No |
Post New Answer View All Answers
Write a program to identify if a given binary tree is balanced or not.
Can true be a variable name in c?
Explain the use of bit fieild.
Can the curly brackets { } be used to enclose a single line of code?
What are near, far and huge pointers?
What does c value mean?
How can I read/write structures from/to data files?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
Explain how do you search data in a data file using random access method?
What is c system32 taskhostw exe?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
What is array in c with example?
Is it possible to initialize a variable at the time it was declared?
Explain how can I read and write comma-delimited text?
What is the difference between fread and fwrite function?