fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. #include<iostream>
  13. using namespace std;
  14. int main()
  15. {
  16. int p,r,t,i;
  17. cout<<"enter the principle value:";
  18. cin>>p;
  19.  
  20. cout<<"enter the interest rate in decimal form:";
  21. cin>>r;
  22.  
  23. cout<<"the amount of time: ";
  24. cin>>t;
  25.  
  26. i=(p*r*t);
  27. cout<<"the interest rate will be: "<<i;
  28.  
  29. return 0;
  30. }
  31. }
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:12: error: illegal character: '#'
		#include<iostream>
		^
Main.java:13: error: ';' expected
using namespace std;
     ^
Main.java:14: error: ';' expected
int main()
        ^
Main.java:17: error: not a statement
 cout<<"enter the principle value:";
     ^
Main.java:18: error: not a statement
 cin>>p;
    ^
Main.java:20: error: not a statement
 cout<<"enter the interest rate in decimal form:";
     ^
Main.java:21: error: not a statement
 cin>>r;
    ^
Main.java:23: error: not a statement
 cout<<"the amount of time: ";
     ^
Main.java:24: error: not a statement
 cin>>t;
    ^
Main.java:27: error: not a statement
 cout<<"the interest rate will be: "<<i;
                                    ^
10 errors
stdout
Standard output is empty