Skip to main content

Find Average of class using C-language

 PROGRAM:- 


#include<stdio.h>
void main()
{
int i,j,sum=0,num;
int marks[100];
float avg;

printf("Enter number of students in class :\n");
scanf("%d",&num);

printf("Enter marks of all students :\n");

for(i=0;i<num;i++)
{
scanf("%d",&marks[i]);
sum+=marks[i];
}

avg=sum/num;

printf("Average of class is %f\n",avg);
}



OUTPUT :-

Enter number of students in class :

10

Enter marks of all students :

50  60  65  70  80  35  48  90  88  78


Average of class is 66.000000



Program File:(click the following .c file to get the program file) 

                   Average_Class.c


Comments

Post a Comment

Popular posts from this blog

Logical Reasoning.

  Quiz 2:- 2.In a code language QUEEN is written as OVCFL, then KING is written as a. IJLH b. MKOF c. PHIK d. FOKM Answer:-  a. IJLH Explanation: Alphabet Series - A B C D E F G H I J K L M N O P Q R S T U V W X Y Z The coding follows the rule -2, +1, -2, +1, etc. That means Q -2 = O U+1=V E-2=C, etc.

Logical Reasoning

Quiz 4:-   4. If DOOR = 25, LOWER=37, TOWER=18, then OVER = ? a.85 b.60 c.45 d.06 Answer:- d.06 Explanation:- Alphabets and their positions |A|B|C|D|E|F|G|H|I|J| | K|L|M|N|O|P|Q|R| |S|T |U|V|W|X|Y|Z| |1|2 |3|4 |5|6|7 |8|9|10| |11|12|13|14|15|16|17|18| |19|20|21|22|23|24|25|26 | Rule:- Add positions of alphabets and then reverse the result DOOR = 4+15+15+18 = 52 = reverse 52 to give 25 and so on...

Logical Reasoning

  Quiz 7 7. CEGI : JHFD :: KMOQ : ? a. LPNR b. RNPL c. LNPR d. RPNL Answer:  d. RPNL Explanation: Alphabet Series:- A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Write the next letters after the letters CEGI. We get DFHJ. Reverse them to get JHFD Next letters after KMOQ is LNPR. Reversing them we get RPNL