Computer Science, asked by sakshisrivastava12, 9 months ago

Write a program to initialize a three digit integer number 297 to a variable. Compute the product of first

two digits and the last digit using suitable process of number separation (do not take digits 2, 9 and 7

separately). Print the number and product.

Answers

Answered by srajfaroquee
1

Answer:

Note: I am writing only the main function; language used: C++

int main() {

   int num,rem,a,b,c ;

   cout<<"Enter a three digit number: ";

   cin>>num ;

   a = num % 10;

   rem = num / 10;

   b = rem % 10;

   rem = rem / 10;

   c = rem % 10;

   cout<<"\nThe value of three digit are " <<c <<" " <<b <<" " <<a <<" "  ;

   cout<<"\nProduct of first two digit and last digit " << (c*b)*a <<" ." ;

return 0;

}

//Please mark this ans as Brainliest answer! Thank you.

Similar questions