Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Java/Java_datatypes
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();

for(int i=0;i<t;i++)
{

try
{
long x=sc.nextLong();
System.out.println(x+" can be fitted in:");
if(x>=-128 && x<=127)System.out.println("* byte");
//Complete the code
}
catch(Exception e)
{
System.out.println(sc.next()+" can't be fitted anywhere.");
}

}
}
}