Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 8. Product From Within
- I believe that there is a product in everything, most especially in two-digit integers! Each digit has a value and if you multiply each value then you would without a doubt get a product. Now go ahead and do just that
- Inputs
- 1. The two-digit integer
- */
- #include <stdio.h>
- int main (){
- int num,s1,s2,s3;
- printf("Etner the 2-digit integer: ");
- scanf("%d",&num);
- s1 = num % 10; // last digit
- num = num / 10;
- s2 = num % 10; //first digit
- s3 = s2 * s1;
- printf("Product of %d and %d: %d",s2,s1,s3);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement