Thursday 12 July 2012

Calculate Average in C



 #include<stdio.h>
 #include<conio.h>
 void main()



 {
    int a,b,c,d,e;

    clrscr;

  printf("enter the value of a");
  scanf("%d",&a);

  printf("enter the value of b");
  scanf("%d",&b);

  printf("enter the value of c");
  scanf("%d",&c);

  printf("enter the value of d");
  scanf("%d",&d)

  e=(a+b+c+d)/4;     // Average Formula

  printf("%d",e);

  getch;      
 }

No comments:

Post a Comment