Blogger Tips And Tricks
Wap in cpp for finding average of five numbers using array
#include<iostream.h>
#include<conio.h>
void main()
{
int list[5],sum=0,avg;
cout<<”enter the 5 number to find the average”;
cin>>list[0] >>list[1] >>list[2] >>list[3] >>list[4];
sum= list[0] + list[1] + list[2] + list[3] + list[4];
avg=sum/5;
cout<<avg;
getch();
}
No comments:
Post a Comment
If You Like The Post Or want to Add Something More
then feel free to comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
If You Like The Post Or want to Add Something More
then feel free to comment