C Program
C Program find Sum and Average of the Three Number
Examples :-
#include<stdio.h>
void main()
{
int a,b,c,s,v;
printf("Enter First Number:");
scanf("%d",&a);
printf("Enter Second Number:");
scanf("%d",&b);
printf("Enter Third Number:");
scanf("%d",&c);
s=a+b+c;
printf("sum of given Numbers is %d\n",s);
v=s/3;
printf("Average of given Number is %d",v);
}
Explain Program
Step :1
#include<stdio.h>
- use functions like printf() and scanf().
Step :2
void main()
- Defines the main function
Step :3
int a, b, c, s, v;
- a, b, c: To store the three input numbers.
- s: To store the sum of the numbers.
- v: To store the average of the numbers.
Step :4
printf ("Enter First Number");
- Displays a message user to enter the first number.
Step :5
scanf("%d", &a);
- input to the user and stores it in variable a.
- %d specifies that the inputs is an integer.
- & a is the address of variable a
Step :6
s = a + b + c;
- Add the three integer and stores the result in s.
Step :7
printf ("Sum of given Number %d\n", s);
- Prints the calculated sum using %d
Step :8
v = s / 3;
Divides the sum by 3 to find the average.
Step :9
printf("Average of given Numbers is %d", v);
- Prints the calculated average.
C Program find Sum and Average of the Three Number
Program Output
Related Post :-





![Q.1] C Program Print Right Half Pyramid pattern Program Output ;- Run 2 Time Q.1] C Program Print Right Half Pyramid pattern Program Output](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTZ548xaRJXuvQLhdu7VO195l9i-MEh3tcpycpE7Q1Bkgciozac924v8Sgm247Xazr5Da9uwkbxCcsFS4JB3QCMvrW1A37iitbYZDAYxxzfvMSnrqqHpvnsKALIhtPnZzWwf3SVVGER0A1Nx_WCbEsJm5jD1Y7Gjr1fa0lOa_OraVpjPM3ygnavghOR0Do/w320-h186-rw/WhatsApp%20Image%202025-02-24%20at%2011.00.40%20PM%20-%20Copy.jpeg)
