Saved Bookmarks
| 1. |
Give me some programs in java to use different types of operators . |
|
Answer» some PROGRAMS of java are :- on operators /* PROGRAM to add three numbers */ PUBLIC class addnum { public static void MAIN(STRING arg []) { int num1 = 20 int num2 = 30 int num3 = 40 int tot; tot = num1 + num2 + num3 ; system.out.printIn("total of + num1 +"and" + num2 +"and"+num3+"is"+tot); } } control flow statements program to display table of 3 using for loop public class table of3 { public satic void main(string arg []) { int i,j; for (i = 1 ; <= 10;i++) { j = 3 * i; system.out.printIn("3*"+i+"="+j); } } } |
|