Computer Science, asked by Mannatc260, 2 months ago

Take 10 integers from keyboard using while loop and print their average value on the screen. e

Answers

Answered by snehalrajnor
1

Answer:

Def sum(n):

sum=0

for I in range(n):

sum+=I

return(sum/10)

i=1

while i<=10:

n=int(input())

print(sum(n))

Answered by pragyakirti12345
5

Answer:

Explanation:

//Program to take 10 integers using while loop and print average on screen

//C program

#include<stdio.h>

#include<conio.h>

int main(){

int n=1 ;

int sum = 0;

float avg;

int num ;

while(n<=10){

scanf("%d",&num);

sum = sum + num;

n++;

}

avg = sum/10;

printf("%f", &avg);

getch();

}

#SPJ3

Similar questions