write a program to display your class and section in the same line
please answer this blinks help me it's lab activity
Answers
Answered by
3
Answer:
#include<stdio.h>
void main()
{
printf("Class=[your class]");
printf("Section=[your section]");
}
Answered by
9
Answer:
// write a program to display your class and section in the same line
//importing Scanner class
import java.util.Scanner;
public class Brainly {
public static void main(String[] ar) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter your class: ");
String Class = sc.next(); //class can also be in roman number :)
System.out.print("Enter your section: ");
String section = sc.next();
System.out.println("Your class and section is " + Class + " " + section + ".");
//closing scanner
sc.close();
}
}
TIPS:-
- You can use '+' operator to concatenate strings :D
Similar questions