Sunday, 29 April 2018

Program to find Average of five number in c using while loop statement

/* avg of five number */
# include <stdio.h>
void main ()
{
int i=0,a,avg ;
int sum =0 ;
clrscr () ;
while ( i<5 )
{
printf ("/n enter a number :") ;
scanf ("%d",& a) ;
sum = sum+a ;
i++ ;
}
avg = sum\5 ;
printf ("/n avg = %f", avg) ;
getch () ;
]

No comments:

Post a Comment

Featured post

Program to find maximum of three number using user define function in C++

A function can be define by the user as per the requirement of the user or programmer . To implement a user define function , a programmer ...