C Program to Multiply two Floating Point Numbers | ZenTek ZenTek: C Program to Multiply two Floating Point Numbers
Contact Us:

If You Have Any Problem, Wanna Help, Wanna Write Guest Post, Find Any Error Or Want To Give Us Feedback, Just Feel Free To Contact Us. We Will Reply You Soon.

Name: *


Email: *

Message: *


ZenTek

LiveZilla Live Help

C Program to Multiply two Floating Point Numbers

In this program, user is asked to enter two floating point numbers and this program will mulitply these two numbers and display it.

Source Code


/*C program to multiply and display the product of two floating point numbers entered by user. */

#include <stdio.h>
int main( )
{
    float num1, num2, product;
    printf("Enter two numbers: ");
    scanf("%f %f",&num1,&num2);        /* Stores the two floating point numbers entered by user in variable num1 and num2 respectively */
    product=num1*num2;  /* Performs multiplication and stores it */
    printf("Product: %f",product);
    return 0;
}

Output

Enter two numbers: 2.4
1.1
Sum: 2.640000

Explanation

In this program, user is asked to enter two floating point numbers. These two numbers entered by user will be stored in variables num1 and num2 respectively. This is done using scanf( ) function. Then, * operator is used for multiplying variables and this value is stored in variable product.

Multiplication of two floating point numbers in C programming

Then, the product is displayed and program is terminated.



Like the Post? Share with your Friends:-

Team SB
Admin: Akash

0 comments:

POST A COMMENT

Contact Us

Name

Email *

Message *

 

About Me

Hello Guys

I am an IT(Information Technology) Student design this blog for your Preference I always enjoyed technical things as a kid

now here i am sharing my knowledge about Tips and Tricks In Internet PC Windows Free Recharges and Other Cool Stuffs Too

So enjoy it

Followers

Widget by : ZenTek
Widget by : ZenTek
Copyright © . ZenTek. All Rights Reserved.
Designed by :-Way2themes