C Program to Additon of Two Numbers

C Program to Additon of Two Numbers

In the C program, addition is a basic arithmetic operation performed using the ‘+‘ operator. The ‘+‘ operator adds two numeric values together. Here’s a simple example:

Interger Numbers :

#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
printf(“Enter first Number = “);
scanf(“%d”,&a);
printf(“Enter Second Number = “);
scanf(“%d”,&b);
c=a+b;
printf(“Sum of two numbers is = %d”,c);
}

Output :

Float Numbers :

#include<stdio.h>
#include<conio.h>
main()
{
float a,b,c;
printf(“Enter first Number = “);
scanf(“%f”,&a);
printf(“Enter Second Number = “);
scanf(“%f”,&b);
c=a+b;
printf(“Sum of two numbers is = %0.2f”,c);
}

Output :

Leave a Comment

Your email address will not be published.

Shopping Basket
Verified by MonsterInsights