Practical 5
Practical 5
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 . . .