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 / gaurav

#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)
");
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 ",stud[i].name);
printf("Departemt of student is %s ",stud[i].dept);
printf("Roll no of student is %d ",stud[i].roll);
printf("Year of joining is %d ",stud[i].year_join);
printf("Course of student is %s ",stud[i].course);
}
getch();
}

Is This Answer Correct ?    7 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of this pointer?

1222


Tell me what are bitwise shift operators?

1094


Is boolean a datatype in c?

1014


What is the advantage of an array over individual variables?

1190


how can use subset in c program and give more example

1933


Is array name a pointer?

999


What is the general form of #line preprocessor?

950


Tell me is null always defined as 0(zero)?

1038


What is the maximum no. of arguments that can be given in a command line in C.?

1089


program to convert a integer to string in c language'

2401


Is c compiled or interpreted?

1130


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1676


c program for searching a student details among 10 student details

2043


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2310


Do you know the purpose of 'register' keyword?

975