Tuesday, 29 September 2015

C Program to find average of three numbers



/*C Program to find average of three numbers*/
#include<stdio.h>
main()
{
      int num1,num2,num3;
      printf("\n Enter the first number ");
      scanf("%d",&num1);
      printf("\n Enter the second number ");
      scanf("%d",&num2);
      printf("\n Enter the third number ");
      scanf("%d",&num3);
      printf("\n The average of %d, %d, & %d is %d",num1,num2,num3,((num1+num2+num3)/3));
}

No comments:

Post a Comment