Monday, August 22, 2022

Sum and Product of Two Numbers in C

 Machine Problem

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 at 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.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada


09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada

Thank you very much for your support.




Program Listing

// add_product.c

// Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT

// Date     : November 11, 2018  Sunday 11:02 PM

// Location : Bacolod City, Negros Occidental

// Tool     : Dev C++ Version 5.11

// Website  : http://www.jakerpomperada.com

// Email    : jakerpomperada@jakerpomperada.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 in C");

   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