C Program to Find Sum and Average of Two Numbers

C Program to Find Sum and Average of Two Numbers

In this programm we will start with “Sum and Average of Two Numbers “. Write a  program to sum and average of two number  program in C  after that execute the program and program will print output.

 


#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,sum,ave;
clrscr();
printf("\n Enter First No:");
scanf("%d",&num1);
printf("\n Enter Second No:");
scanf("%d",&num2);
sum=num1+num2;
printf("\n The Sum of Two No=%d",sum);
ave=sum/2;
printf("\n The Ave=%d",ave);
getch();
}

Output

  1. In this C program example, we will implement the program, how to find sum and average of two integer numbers?
  2. Here, in this program we taking input from the user of two integer number, num1 and num2.
  3. Sum of the numbers is calculating by num1+num2 and assigning into variable sum and average of numbers in calculating by (sum)/2 and assigning to variable avg.
  4.  
TOP