Escolar Documentos
Profissional Documentos
Cultura Documentos
R13 Syllabus
SPECIFICATION:
(15)(a).C Program to store information of 10 students using structures and display
ALGORITHM:
STEP 1: START
STEP 2:
done
STEP 6 : STOP
FLOWCHART
START
Declare i
FALSE
For i0 in steps of 1 do where i< 10
s[i].rolli+1
Display s[i].roll
Read Name
Read Marks
TRUE
FALSE
TRUE
STOP
PROGRAM
/* C program to display details of 10 students using structures */
Program name:
/* Done By : C-Faculty
#include<stdio.h>
struct student
{
int roll;
char name[50];
float marks;
};
int main()
{
struct student s[10];
int i;
printf(enter information for 10 students);
for(i=0;i<10;++i)
{
s[i].roll=i+1;
printf(for roll no. %d,s[i].roll);
printf(enter the name);
scanf(%s,%s[i].name);
printf(enter marks);
scanf(%f,&s[i].marks);
}
printf(display details of 10 students);
Department of Computer Science & Engg
// wk15a.c
Dated: 15/10/2013*/
for(i=0;i<10;++i)
{
printf(information of roll no. %d,i+1);
printf(name:);
puts(s[i].name);
printf(marks are %f,s[i].marks);
}
return(0);
}
PROCEDURE FOR EXECUTING THE PROGRAM:
Step 1: After typing the program, press ESC button+shift+: and then type wq(to save the
program and quit)
Step 2: Now compile the program by using the following command
cc wk15a.c lcurses -lm
Step 3: Now go for running the program by using the command
./a.out