OOPJ PROGRAMS
Practicals 1. Write a program to print “Hello CGPIT” on the console . public class pr1 { public static void main ( String args []) { System . out . println ( "Hello CGPIT" ); } } output: 2. Write a program to print inputs given from command line arguments on the console. public class pr2 { public static void main ( String args []) { for ( int i = 0 ;i< args . length ;i++) { System . out . println (args[i]); } } } output: 3. Write a program to check whether given number is Armstrong or not. import java.util.Scanner; public class ars { public static void main ( String args []) { int n , temp , sum = 0 ,r; Scanner s1 = new Scanner ( System . in ); ...
Comments
Post a Comment
Give your Feedback