This C programming example demonstrate the product of two floating type numbers. The product of floating type numbers is achieved using the arithmetic * operator, similar to integer type variables.

#include <stdio.h> int main(){ float number1, number2, product; printf("Enter first Number: "); scanf("%f", &number1); printf("Enter second Number: "); scanf("%f", &number2); //Multiply number1 and number2 product = number1 * number2; // Displaying result up to 3 decimal places. printf("Product of entered numbers is:%.3f", product); return 0; }

Case 1: Enter first Number: 937.65 Enter second Number: 137.98 Product of entered numbers is:129376.945 Case 2: Enter first Number: 48.89 Enter second Number: 37.81 Product of entered numbers is:1848.531

1. In this program, user is asked to enter two numbers one by one. These two numbers entered by the user are stored in the floating type variables number1 and number2. This is done using scanf() function. 2. Then, the product of number1 and number2 is evaluated and the result is stored in another floating type variable product. 3. Finally, the value of variable product is displayed on the screen using printf() function. 4. Here note that %.3f is used instead of regular %f format specifier. This is to limit the product result up to three decimal places.

Questions from Previous year GATE question papers

UGC NET Previous year questions and practice sets

Attempt a small test to analyze your preparation level. This GATE exam includes questions from previous year GATE papers.

Practice test for UGC NET Computer Science Paper. The questions asked in this NET practice paper are from various previous year papers.