Wap to enter 10 numbers and find the average with the last digit 2 or 4.
for loop in c++ pls help me
Answers
Answered by
0
Answer:
#include <stdio.h>
void main()
{
int i,n,sum=0;
float avg;
printf("Input the 10 numbers : \n");
for (i=1;i<=10;i++)
{
printf("Number-%d :",i);
scanf("%d",&n);
sum +=n;
}
avg=sum/10.0;
printf("The sum of 10 no is : %d\nThe Average is : %f\n",sum,avg);
}
Explanation:
Mark me as brainliest
Similar questions
Science,
2 months ago
Math,
2 months ago
Environmental Sciences,
4 months ago
History,
10 months ago