[ create a new paste ] login | about

Link: http://codepad.org/yi97HTX2    [ raw code | output | fork ]

godneil - C, pasted on Nov 25:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//Multiply 2 Floating Point Numbers
#include<stdio.h>

int main()
{
    double a, b, product;
    printf("Enter two numbers ");
    
    scanf("%lf %lf", &a, &b);
    product = a*b;
    
    printf("product = %.2lf", product);//2 decimal places
    
    return 0;
    
    
    
}


Output:
1
Enter two numbers product = 0.00


Create a new paste based on this one


Comments: