Friday, September 25, 2020

Sum and Product of Two Numbers in C

 Create and Design a program that will ask the user to give two numbers and then the program will compute the sum and product of the given numbers and display the results on the screen.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.



Program Listing

/* add_product.c
   Author   : Jake Rodriguez Pomperada,MAED-IT,MIT
   Date     : September 25, 2020   Friday 3:32 PM
   Location : Bacolod City, Negros Occidental
   Tool     : Dev C++ Version 5.11
   Websites : http://www.jakerpomperada.com
              http://www.jakerpomperada.blogspot.com 
   Email    : jakerpomperada@gmail.com
*/

#include <stdio.h>

int main() 
 {
 
   int a=0,b=0,sum=0,product=0;
   system("COLOR F0");
   printf("\n\n");
   printf("\tSum and Product of Two Numbers");
   printf("\n\n");
   printf("\tGive First Number  : ");
   scanf("%d", &a);
   printf("\n");
   printf("\tGive Second Number : ");
   scanf("%d", &b);
   
   // Compute the sum and product
   sum = (a+b);
   product = (a*b);
   
   printf("\n");
   printf("\tThe sum of %d and %d is %d.",a,b,sum);
   printf("\n\n");
   printf("\tThe product of %d and %d is %d.",a,b,product);
   printf("\n\n\n");
   printf("\tEND OF PROGRAM");
   printf("\n\n");
}

No comments:

Post a Comment