filmov
tv
C Programming Lab | a program to store information of 5 students structure and display in Turbo C++

Показать описание
In this Tutorial C Programming Lab learn programming experiment a program to store information of 5 students structure and display in Turbo C++ Software.
#CProgrammingLab
Experiment Step :
1. Open Turbo C++ Software
2. Create New File
3. Write Program Code
4. Click on Compile tab
5. Click Run and get student structure data.
Program Code :
# include stdio.h
struct student
{
char name[30];
int roll;
float marks;
} s[5];
int main( )
{
int i;
printf(“Information of students:”);
for (i=0; i 5; ++i)
{
s[i].roll =i+1;
printf(“\n Roll number %d, \n”, s[i].roll);
printf(“Enter name:”);
scanf(“%s”, s[i].name);
printf(“Enter marks:”);
scanf(“%f”, &s[i].marks);
}
printf(“\n Displaying Information:\n”);
for(i=0;i 10;++i)
{
printf(“\n Roll number:%d \n”, i+1);
printf(“Name:”);
puts(s[i].name);
printf(“\n Marks:%.1f”, s[i].marks);
}
return 0;
For more information, Contact Us
Pradeep Sharma
Background Music By :-
Song: Ikson - To You
Music promoted by Vlog No Copyright Music.
#CProgrammingLab
Experiment Step :
1. Open Turbo C++ Software
2. Create New File
3. Write Program Code
4. Click on Compile tab
5. Click Run and get student structure data.
Program Code :
# include stdio.h
struct student
{
char name[30];
int roll;
float marks;
} s[5];
int main( )
{
int i;
printf(“Information of students:”);
for (i=0; i 5; ++i)
{
s[i].roll =i+1;
printf(“\n Roll number %d, \n”, s[i].roll);
printf(“Enter name:”);
scanf(“%s”, s[i].name);
printf(“Enter marks:”);
scanf(“%f”, &s[i].marks);
}
printf(“\n Displaying Information:\n”);
for(i=0;i 10;++i)
{
printf(“\n Roll number:%d \n”, i+1);
printf(“Name:”);
puts(s[i].name);
printf(“\n Marks:%.1f”, s[i].marks);
}
return 0;
For more information, Contact Us
Pradeep Sharma
Background Music By :-
Song: Ikson - To You
Music promoted by Vlog No Copyright Music.