Friday, May 10, 2019

C programming : Program to find the sum and product of two numbers


/* Program to find the sum and product of two numbers */

#include<stdio.h>
#include<conio.h>
void main ()
{
int a,b,sum=0, product=0;
clrscr();
printf ("\n Enter the value of a and b ");
scanf ("%d %d",&a,&b);
sum=a+b;
printf ("\n The sum of two numbers is %d",sum);
product=a*b;
printf (" \n The product of two numbers is=%d",product );
getch();
}

Output:

Enter the value of a and b
12
6
The sum of two numbers is 18
The product of two numbers is72
 
Now the output will be seen as given below:


1 comment:

Function

FUNCTION C enables programmer to break up a program into segments commonly known as functions, each of which can be written more or...