the problem with this is that after it accepts the four (4) integers it stop and dont go on to find the average. IS THERE ANYONE OUT THERE THAT CAN HELP. NUFF RESPECT TO ALL WHO TRY TO HELP.
//to calculate the average of 4 numbers
#include<stdio.h>
int get4ints(){//function to collect 4 integers
int count,*num,number[4];
for(count=0;count<4;count++){
if (count==0){printf("you are required to enter 4 integers\n");
}
printf("enter number\n");
scanf("%d",&number[count]);}
return *number;}//return the value of the first element in the array
//main program to call the array for 4 ints and return average
int main()
{
int *num,number,sum=0,count,exit;
*num=get4ints();//num points to the first element of the array
for(count=0;count<4;count++){//loop to print the values in the array
*num=*(num+count);
printf("number is %d",*num);
sum=sum+*num;}
int average=sum/4;//calculate the average
printf("the average is %d",average);//print the average
printf("enter a key to exit");//A KEY IS ENTERED THEN THE PROGRAM EXIT
scanf("%d",&exit);
}