C Program To Add Two Float Numbers – If you are looking for the addition of two floating numbers program in C, here in this tutorial we will help you to learn how to write a c program to add two floating numbers.
C Program To Add Two Float Numbers
Just copy-paste the below source code to add two float numbers in the C compiler to test, how the source code works. Debug and learn how it works. Happy coding.
C Program To Add Two Float Numbers Source Code
/* C Program to Add Two Float Numbers - AddFloatNumbers.C */ #include<stdio.h> #include<conio.h> void main( ) { //floating variables declaration float num1,num2,sum; clrscr( ); //asking user to enter first floating number printf("Enter first number: "); scanf("%f",&num1); //reading the float number //asking user to enter second floating number printf("Enter second number: "); scanf("%f",&num2); //reading the second float number //simple addition logic to add two float numbers sum=num1+num2; //printing sum of the two float numbers printf("Sum of two numbers = %f",sum); getch( ); }
C Program To Add Two Float Numbers Output
Enter first number: 2.3
Enter second number: 4.2
Sum of two numbers = 6.5
C PROGRAMMING EXAMPLES
- C Program To Arrange Numbers In Descending Order
- C Program to Add Days to Date
- C Program to Add Two Fractions
- C Program To Reverse A Number
- C Program to Find Maximum and Minimum Numbers
- C Program to Read a Text File
- C Program to Convert Decimal to Hexadecimal
- C Program to Convert Decimal to Binary
- C Program to Convert Celsius to Fahrenheit
- C Program To Find Absolute Value
- Ternary Operator Program in C
- C Program For Addition Table Using For Loop
- Denomination Program in C
- C Program to Print Multiplication Table
- C Program Array with Example
- Binary Search in C Program Using Recursion
- Bubble Sort in C Using Pointers
- Bubble Sort Program in C Using Recursion
- Bubble Sort Program in C Using Array
- Bubble Sort Program in C Using Function