filmov
tv
C Program to add two numbers | addition of two numbers in c programming
![preview_player](https://i.ytimg.com/vi/-IYfjM2dWqA/maxresdefault.jpg)
Показать описание
C Program to add two numbers || addition of two numbers in c programming
Explanation :
The program first includes the standard input-output library (stdio.h).
It then defines the main() function, which is the entry point of the program.
The variables num1, num2, and sum are declared to store the two input numbers and their sum.
The program prompts the user to enter two numbers, which are then stored in num1 and num2.
It calculates the sum of the two numbers using the + operator and stores the result in sum.
Finally, the program prints out the sum of the two numbers.
Explanation :
The program first includes the standard input-output library (stdio.h).
It then defines the main() function, which is the entry point of the program.
The variables num1, num2, and sum are declared to store the two input numbers and their sum.
The program prompts the user to enter two numbers, which are then stored in num1 and num2.
It calculates the sum of the two numbers using the + operator and stores the result in sum.
Finally, the program prints out the sum of the two numbers.