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
What is the use of ?
Subtract Two Number Without Using Subtraction Operator
Simplify the program segment if X = B then C ← true else C ← false
How do you define CONSTANT in C?
What are qualifiers and modifiers c?
Why malloc is faster than calloc?
What is a structure in c language. how to initialise a structure in c?
What math functions are available for integers? For floating point?
Why C language is a procedural language?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
int i=10; printf("%d %d %d", i, i=20, i);
What is volatile variable in c with example?
Sir i need notes for structure,functions,pointers in c language can you help me please
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
What are compound statements?