Major: TMD
Here I explain about how returned data array, the total number, average and I have been made code and video in the below.
Code
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(void)
{
int ter[5],n=0,k;
float total = 0;
printf("Enter the amount of data you want:(1 - 5)\n");
printf("Please enter number:");
while(n <= 0 || n > 5){
scanf("%d", &n);
}
for(k = 0; k<n; k++){
printf("\nEnter %d amount : ",k+1);
scanf("%d", &ter[k]);
}
for(k = 0; k < n; k++){
printf("\nData %d that you have been insert : %d", k+1, ter[k]);
total = total + ter[k];
}
printf("\n\nTotal amount that have insert : %.0f\n", total);
printf("Average amount all the data you insert: %.2f\n", total/n);
system("pause");
return (0);
}
Video Clip
Link to video.
http://www.youtube.com/watch?v=H8ZOjVGCmPs&feature=youtu.be
No comments:
Post a Comment