Saturday 30 September 2017

Sum of numbers using c program

In this tutorial we will discuss on how to find the sum of two numbers using c program.
For any c program the header file that must be included is stdio.h which stands for standard input output.

PROGRAM:

#include<stdio.h>
void main()
{
int a,b,sum;
printf(“Enter two numbers \n”);
scanf(“%d%d”,&a,&b);
sum=a+b;
printf(“Sum of two numbers is %d”,sum);
}



OUTPUT:

Enter two numbers
2 3

Sum of two numbers is 5

No comments:

Post a Comment

Convert a square matrix to Lower and Upper Triangular Matrix

Upper and Lower triangle Matrix Using C program In this program we will be discussing on how to convert a square matrix into correspon...