Write a simple program to print your name and your fathers name by using system out.println() and system out.println()
Answers
Answer:
import java.lang.*;
public class simple{
public static void main (string args){
int n,m;
scanner in = new scanner (system.in){
system.out.println(enter your name);
int n=in.next int ();
system.out.println(enter your father name);
m=in.next int();
{
system.out.println("Father name="+n "/t" "My name="+m);
}
}
}
Explanation:
i have included scanner class also in this programme but u can avoid in my directly printing it.I have used scanner class bcz i got the value from user and then printed it.. but u can directly print it or instead of scanner class u can us buffer reader also..
Answer:
Java public lags;
public class main;
Public. static. void. main(arges[])
int=n, m
in scanner =new scanner (system. in);
system. out. printIn(my name)
in n=in.next.int;
system. out. printIn(name of father)
m=in.next.int;
system. out. printIn(father name +m/t
my name ++n)
}
}