In this tutorial learn how you can get three numbers from the user and add three numbers. First, we will ask the user for the numbers and then add those numbers.
C programming is a powerful general-purpose programming language. It can be used to develop software like operating systems, databases, compilers, etc.
Here is the code to add three numbers. Get numbers from the user in C programming.
#include <stdio.h> //WAP to add three numbers. Get numbers from the user.
int main(){
int first_number,second_number,third_number,sum;
printf("Please enter the first number:");
scanf("%d",&first_number); //Get first number from user
printf("Please enter the second number:");
scanf("%d",&second_number); //Get second number from user
printf("Please enter the third number:");
scanf("%d",&third_number); //Get third number from user
sum = first_number+second_number+third_number;
printf("The total sum is:%d",sum); //Displays sum
return 0;
}
This is how you can get numbers from the user and add three numbers in c programming. Comment below if you like our tutorial.
I am live on these platform.Thus,you can contact me on the contact below.
0 Comments