Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is scope rule of function in c?

1031


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1215


How many loops are there in c?

1049


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2404


Is fortran still used today?

1044


How can I pad a string to a known length?

971


What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

1024


Is multithreading possible in c?

952


Explain what is the benefit of using an enum rather than a #define constant?

1172


What are the types of data files?

1154


Why double pointer is used in c?

991


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

3859


What is && in c programming?

1113


Describe the modifier in c?

1060


Is c# a good language?

964