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 / shyam kumar thapa
/*Program to specify data of students*/
#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)\n");
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\t",stud[i].name);
printf("Departemt of student is %s\t",stud[i].dept);
printf("Roll no of student is %d\t";stud[i].roll);
printf("Year of joining is %d\t",stud[i].year_join);
printf("Course of student is %s\t",stud[i].course);
}
getch();
}
Is This Answer Correct ? | 122 Yes | 56 No |
Post New Answer View All Answers
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What are the different types of control structures?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
Write a program to print factorial of given number using recursion?
What is the general form of #line preprocessor?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
What functions are used for dynamic memory allocation in c language?
Why & is used in c?
What is a built-in function in C?
What are the different types of errors?
Who developed c language and when?
What is the use of the function in c?
When should I declare a function?
Hai what is the different types of versions and their differences
In which layer of the network datastructure format change is done