0% found this document useful (0 votes)
6 views1 page

Lab Task 4 Os

Uploaded by

sibte638
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Lab Task 4 Os

Uploaded by

sibte638
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

LAB TASK 4

NAME M SIBTE HASSAN


CLASS BSIT-4
ROLL NOITS-11163

NO 1: CODE IN C LANGUAGE

This C program snippet demonstrates the multiplication of two floating-point numbers and
displays the result.

1. float num1, num2, product;: Declares three floating-point variables: num1 and num2
to store the input numbers, and product to store the result of their multiplication.
2. scanf("%f", &num1);: Prompts the user to input the first number and stores it in num1.
3. scanf("%f", &num2);: Prompts the user to input the second number and stores it in
num2.
4. product = num1 * num2;: Multiplies the values of num1 and num2 and stores the result
in the product variable.
5. printf("The product of %.2f and %.2f is %.2f\n", num1, num2, product);:
Prints the two input numbers and their product, formatted to two decimal places, in the
format:
6. The product of <num1> and <num2> is <product>

You might also like