[ create a new paste ] login | about

Link: http://codepad.org/rsw1evEi    [ 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
//Multiply 2 Floating Point Numbers from Users
#include<stdio.h>

int main()
{
    double x, y, z;
    printf("Please enter two numbers: ");
    scanf("%lf %lf", &x, &y);
    
    z = x * y;
    
    printf("%.2lf * %.2lf = %.2lf", x, y, z);//2 decimal places 
    
    return 0;
    
}


Output:
1
Please enter two numbers: 0.00 * 0.00 = 0.00


Create a new paste based on this one


Comments: