input program in java : write a program to input 3 numbers and find their product?
In C++ program
tell me the correct answer and I mark you as brainliest
Answers
CⓞDE In JAVA
import java.util.*;
public class BeBrainly
{
public static void main(String[] args)
{
int a, b, c, result;
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the 1st no:");
a = scanner.nextInt();
System.out.println("Enter the 2nd no:");
b = scanner.nextInt();
System.out.println("Enter the 3rd no:");
c = scanner.nextInt();
result = a*b*c;
System.out.println("The product of a, b and c is: "+result);
}
}
Example Output:
Enter the 1st no:
10
Enter the 2nd no:
20
Enter the 3rd no:
30
The product of a, b and c is: 6000
CⓞDE In C++
#include <iostream>
using namespace std;
int main()
{
int x, y, z, product;
cout << "Enter 1st no: ";
cin >> x;
cout << "Enter 2nd no: ";
cin >> y;
cout << "Enter 3rd no: ";
cin >> z;
product = x*y*z;
cout << "Product of a, b and c is: " << product;
return 0;
}
EXAMPLE OUTPUT
Enter 1st no: 10
Enter 2nd no: 20
Enter 3rd no: 30
Product of a, b and c is: 6000
![](https://hi-static.z-dn.net/files/d35/25e3f94459a165133be6813d92821dfe.png)
![](https://hi-static.z-dn.net/files/df4/f93f3e24c0b2442d66392cad6f708ada.png)
![](https://hi-static.z-dn.net/files/d9d/85894c5103e62da2ae780e45441dda1d.png)
![](https://hi-static.z-dn.net/files/d0d/d4d08ae5ae760dc2e0d13611eb14a695.png)