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


Please Help Members By Posting Answers For Below Questions

Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

2654


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2224


Explain the binary height balanced tree?

728


Mention four important string handling functions in c languages .

634


What is "Duff's Device"?

703






Why we use break in c?

555


Explain what is meant by high-order and low-order bytes?

637


What is graph in c?

587


Which is best linux os?

567


What is the difference between malloc() and calloc() function in c language?

607


pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

1865


What are runtime error?

633


Is main is a keyword in c?

613


What is the use of sizeof?

559


What is enumerated data type in c?

631