0% found this document useful (0 votes)
11 views

Practical 5

The document contains a C program that calculates the product of two integers input by the user. It checks if the product falls within the range of a 16-bit signed integer and displays the result accordingly. An example output demonstrates the program's functionality with the integers 78 and 54, resulting in a product of 4212.

Uploaded by

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

Practical 5

The document contains a C program that calculates the product of two integers input by the user. It checks if the product falls within the range of a 16-bit signed integer and displays the result accordingly. An example output demonstrates the program's functionality with the integers 78 and 54, resulting in a product of 4212.

Uploaded by

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

Ankush Kumar Yede

21STAT1101022

Practical 5

Source Code:
#include<stdio.h>
int main()
{
int a,b,product;
printf("Enter the two integers:\n");
scanf("%d %d",&a,&b);
product=a*b;
if ((product>=-32768)&&(product<=32767))
{
printf("Product is %d",product);
printf(" in range of integers");}
else
printf("Product is out of range of integers");
return 0;
}

Output:
Enter the two integers:
78
54
Product is 4212 in range of integers
--------------------------------
Process exited after 1.439 seconds with return value 0
Press any key to continue . . .

You might also like