Saturday, August 18, 2018

AVERAGES

  • Problem Description

    Menan Working as a professor in ABC college, have to get students three subjects marks and display average.

    so he planned to do one program to implement structure concept.

    Input

    15 16 39

    Output

    15 16 39 23
  • CODING ARENA
  • #include <stdio.h>
    struct average
    {
      int d,b,c;
    }a;
    int main()
    {
      scanf("%d%d%d",&a.d,&a.b,&a.c);
      printf("%d %d %d %d ",a.d,a.b,a.c,(a.d+a.b+a.c)/3);

    return 0;
    }
  • Test Case 1

    Input (stdin)
    15 16 39
    
    
    Expected Output
    15 16 39 23
  • Test Case 2

    Input (stdin)
    56 89 96
    
    
    Expected Output
    56 89 96 80

No comments:

Post a Comment