## 9.16.2011

### Find students grades through structure

Q. Write a C program using structure to find student grades in a class. Make necessary assumption.

Ans.
Before writing program we make some assumption as following :

Maximum total marks is 500.
>=80                        A
>=60                        B
>=50                        C
>=40                        D
<40                         F

/*C program to find students grades in a class through structure */
#include<stdio.h>
#include<conio.h>
struct stud
{
char nam[20];
int obtain_mark;
int per;
};
struct stud s[5];
int i;
int main()
{
for(i=1; i<=5; i++)
{
printf("Enter %d student name : ",i);
scanf("%s",&s[i].nam);
printf("Enter %d student obtained marks = ",i);
scanf("%d",&s[i].obtain_mark);
fflush(stdin);
}
for(i=1; i<=5; i++)
s[i].per=s[i].obtain_mark/5;
for(i=1; i<=5; i++)
{
if(s[i].per>=80)
else if(s[i].per>=60)
else if(s[i].per>=50)
else if(s[i].per>=40)
else
}
for(i=1; i<=5; i++)
getch();
return 0;
}
Output of above programe :

Enter 1 student name : John
Enter 1 student obtained marks : 250
Enter 2 student name : Robert
Enter 2 student obtained marks : 410
Enter 3 student name : Isabell
Enter 3 student obtained marks : 386
Enter 4 student name : Adem
Enter 4 student obtained marks :197
Enter 5 student name :Harry
Enter 5 student obtained marks : 490

1 student Jhon has obtained grade C
2 student Robert has obtained grade A
3 student Isabell has obtained grade B
5 student Harry has obtained grade A

 Figure: Screen-shot of find student grades  through structure C program

Related programs:

1. show how to write a program to convert kg to pounds

2. plz tell how to construct a program o convert wieght from kg to pound where 1 pound=.4536kg

3. plz tell how to construct a program o convert wieght from kg to pound where 1 pound=.4536kg

4. plz tell how to construct a program o convert wieght from kg to pound where 1 pound=.4536kg

5. plz tell how to construct a program o convert wieght from kg to pound where 1 pound=.4536kg

1. I write your C conversion program, with example and how to done the conversion process at:

http://cprogrammingcodes.blogspot.in/2012/03/kg-to-pound-convert.html

6. gud one

7. you forgot the

8. you for got the < string . h >

9. this ish just dont work!!!

In above program there are not required string header file.
And all programs in this site work, run and execute in genuine right way.
(I also mention screen shot of above program).
Note:what u find error?

10. how i make a flow chat of polynomial multiplied by monomial can u help mee plzzz

11. how i make a flow chat of polynomial multiplied by monomial can u help mee plzzz

12. how to make flow chart for this structure programme

13. create a structure employee and insert the details such as employee id,name,age,employ...
give the source code of this

14. plz give me the algorithm&flow chart for this program