0

I have developed a currency converter code in C where if we enter a value the output shows all the values of different currencies. How to do the same in Java ???

16th Mar 2017, 3:02 AM
Krishna Shashank
Krishna Shashank - avatar
3 Antworten
+ 1
I'm not going write full code for you but I will point Java syntaxes you will need. Try ur self. C: printf() Java: System.out.print() C: printf("din value is %d*22",din); Java: System.out.print("din value is " + din + "*22"); Create a object from Scanner class to read user inputs. Scanner input = new Scanner (System.in); //scanf("%d",&rup); rup = input.nextInt();//get the user input value
16th Mar 2017, 4:14 AM
Eranga
Eranga - avatar
0
u simply have to convert(rewrite) your C code to Java. some handy online tools also available.. https://www.mtsystems.com But I recon you to try it your self, it will help you to improve your Java knowledge. Share ur C code so some one can try to convert it to Java.
16th Mar 2017, 3:10 AM
Eranga
Eranga - avatar
0
The following code is the C code for finding currencies of different countries. Now I need to develop this code in java. #include<stdio.h> Int main() { Int rup,usd,din,aed,aud,yen,kd; Printf(" enter the value of rupee :"); Scanf("%d",&rup); Printf("usd value is %d*64",usd); Printf(din value is %d*22",din); Printf("aed value is %d*18",aed); Printf("aud value is %d*51",aud); Printf("yen value is %d*1",yen); Printf("kd value is %d*221",kd); Return 0; }
16th Mar 2017, 3:30 AM
Krishna Shashank
Krishna Shashank - avatar