draw a flowchart to read one integer number and print the value of that number
Answers
Answered by
3
Answer:
How do you draw a flowchart to input n integers in an array and print their sum?
Learn coding and get placed at top tech companies!
// I can give the program
// This Program take input of integer into an array and gives their sum and average
# include <stdio.h>
int main()
{
int a,b,sum=0, avg, i;
printf("Enter the size of the array\n");
scanf("%d",&a);
int number[a];
printf("Enter the value in the array\n");
for(i=0;i<a;i++)
{
scanf("%d", & number[i]);
}
printf("The value in the array are : \n");
for(i=0;i<a;i++)
{
printf("%d\t", number[i]);
}
printf("\n");
for(i=0;i<a;i++)
{
sum=sum+number[i];
}
printf("The sum of all the element of the array is %d\n",sum);
avg= sum/a;
printf("The average of all the element in the array is\n %d\n", avg);
}
Similar questions
Social Sciences,
2 months ago
Math,
2 months ago
Science,
2 months ago
India Languages,
10 months ago
Business Studies,
10 months ago
India Languages,
10 months ago