#include
#include
main()
{
ind r[5],m1[5],m2[5],m3[5],i;
float p[5];
clrscr();
for(i=0;i<5;i++)
{
printf("\nInput roll number and marks in 3 subject for student %d \n",i+1);
scanf("%d%d%d%d",&r[i],&m1[i],&m2[i],&m3[i]);
}
clrscr();
for(i=0;i<75;printf("-"),i++);
printf("\nRoll no\t Marks obtained in \t Percentage\t Result");
printf("\n\t sub1 sub2 sub3\n");
for(i=0;i<75;printf("-"),i++);
for(i=0;i<5;i++)
{
p[i]=(m1[i]+m2[i]+m3[i])/3.0;
printf("\n%d\t%d\t%d\t%d\t%5.2f\t",r[i],m1[i],m2[i],m3[i],p[i]);
if(p[i]<40.0)
printf("\tfail");
else
printf("\tpass");
}
printf("\n");
for(i=0;i<75;printf("-"),i++);
}
To input roll number and marks in 3 subjects for 5 students and print the result sheet.
Labels:
C Assignments
Subscribe to:
Post Comments (Atom)
If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE
More Useful Topics... |
|
History Of C..
In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
My 1st Program...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}
Next Step...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");
printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");
}
pls upload a c program for the following:
ReplyDeleteDesign a structure student_record to contain name, date of
birth and total marks obtained.
Define a structure data type date containing three integer
members namely day, month and year to represent the date of birth.
Develop a program to read data for 10 students in a class and list
them rank-wise.