Skip to content

Instantly share code, notes, and snippets.

@raydvard
Created September 16, 2014 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raydvard/9e7e02668ac358f2c786 to your computer and use it in GitHub Desktop.
Save raydvard/9e7e02668ac358f2c786 to your computer and use it in GitHub Desktop.
Input 3 subjects number for 3 individual students and find out individual average marks by RD
#include<stdio.h>
int main()
{
int a, b, c;
int ns, avg;
ns = 0;
while( ns <= 2 )
{
printf("\nInput Number A : ");
scanf("%d", &a);
printf("Input Number B : ");
scanf("%d", &b);
printf("Input Number C : ");
scanf("%d", &c);
avg = (a + b + c) / 3;
printf("\nAverage Number : %d", avg);
ns = ns + 1;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment