Java Program for Number Mirror | CodeChef Solution with Explanation
Java Program for Number Mirror | CodeChef Solution with Explanation
Problem
Write a program that takes a number N as the input, and prints it to the output.
Input Format
The only line contains a single integer.
Output Format
Output the answer in a single line.
Constraints
- 0 <= N <= 105
Solution :
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
int a;
Scanner sc = new Scanner(System.in);
a = sc.nextInt();
System.out.println(a);
}
}
📚 Top Recommended Books
- JavaScript: The Definitive Guide: Master the World's Most-Used Programming Language, 7th Edition (Greyscale Indian Edition).
- Eloquent JavaScript: A Modern Introduction to Programming.
- You Don`t Know JS: 6 Volume Set (Greyscale Indian Edition).
- Learning JavaScript Design Patterns: A JavaScript and React Developer's Guide, Second Edition (Grayscale Indian Edition).
🤑 Partner Discounts
Disclosure: This post may contain affiliate links, meaning I get a commission if you decide to make a purchase through my links, at no cost to you.