Input Two Numbers and Add their Sum C Program

How to write a c program to inpute two numbers and print their sum in c programming ?


Solution:
//Program to input two numbers and print their sum.
#include<stdio.h>
#include<conio.h>

void main()
{
float number_1, number_2;

clrscr();

printf("Enter two numbers: ");
scanf("%f%f", &number_1, &number_2);
printf("The sum of the numbers %f and %f is: %f", number_1, number_2, number_1 + number_2);

getch();
}



Learn More :