1. Write a Program to Take input from user Print sum and Average of 5 int Number c program .
2. write a Program To take input from user print evaluate the equation 5x2 + 2x -10 c program .
1.
Write a Program to Take input from user Print sum and Average of 5 int Number c program - Program Code.
/* Write a program to print
sum and average of 5 int number */
#include<stdio.h>
#include<conio.h>
int main()
{
int n1,n2,n3,n4,n5,sum;
float avg;
clrscr();
printf("Enter value of n1,n2,n3,n4,n5 : ");
scanf("%d%d%d%d%d",&n1,&n2,&n3,&n4,&n5);
sum = n1+n2+n3+n4+n5;
printf("Sum of this number is %d\n",sum);
avg = sum/5;
printf("Average of 5 int number is %f",avg);
getch();
return 0;
}
PROGRAM :-
OUTPUT :-2.
Download Program source codeDownload Program source code
0 Comments
If You have any query, Please let me know..