You are on page 1of 7

Given Time: ho min tes to cock

Since hos long it is in oven


Inpvt
Hod morH MOve min vtes re
T6ind needad

ode-
Pblic Stcdtic Void Main)

intScamer se neneo Scanner(ystern.in);


int n Sc.MextInt ();
int OnSuer 40-n
ysfem.Out.print In arwer");

2Given

put
Ta find
Each loyer

No.Loyer
Minutea
takes 2mrinutes

to Ccok

Code
Public sttic Veid main (StringC3 args

Scanner SC E new Scanner stem,in) Sy


19t n sc. next Ttl )}
intanS= 2*,
Sstem.out.pmintln (ans");
-3 Giwen Bep time
= 2minvtes lLayer.

No LayCrS
Minutes since inoven
p- Total time

Code
Pblic static Véid main (stigfI ogs)

Scanner Sc new SCannerystem.in)


int

int
int
n
tFo
ans 2
Sc.next TatJ
Sc. next Intl
*
)
int Yesvt:t+ ans
-

System.Out. pristla ("vesult");

-Ilp 2nos. AEB


IP Ax B.
Code

Puic static Void main (5tring L avgs)

Scanner sc= n Scanner ystm.in);


lang a Sc,next Longl )
lonbS. next Logl);

ong C 1Lab
Systen.out. printIn(Hutiplication is"+ C);
stdic Void main
pulic (rigC] args)

Scanne Sc
tot a Sc.next Tht );
neoScanrer(System. in);

int
nt
b
ans .a-b SC. next Int(

System.eut PvintIn (ans)


g p Total

at 1
bill

No. bills.
amt
bill

Code
Peblic static veid main (shig 7ags
Scanner sc= new Scannerystem.in);
Sc. next Double C);

;
dovble money
Jot
int n Se. nextInt );
long
a Math. floor( monn
5ystom.out.pritln C"dumberel ills is ta)

Q.1. Tlp to 12,repredenting months


olp o. days in each h month.

Code
Peblic static Void main (shingC)ajs

Sc"new SanerSystom-in)
SCanner

intn= Sc.hext Tntl )


fln 4 1|n== 6 ||
==
n

ystem.ovt.print n 305 " 9 |! n==N)

elseif (n:= |nm3||n5]l, =7||n8||*


3i ");
Jstm-0t.print In ("
else
ystem, out.prht n ("28")3

.&
fp
Mawks
Percentage
5ad suhjects
Gmde

Code
blic Static Void main (String[]
an1s)

Scanner Sc nes Scanner (5ysten-in)


Int 51 SC.nextInt);
int 52 Sc-nextInt()j
int S3 Stnext Znt);
Int s4 = ScnextIt);
int sS Stnoxt IstO;

f foat Pertentages ((51452tS3t54155|5)


Int
porcentee
=Math.Hoor (penetnýe1);
S4stem.ovt prirtIn ("hepertentage is
tpertertbge
ffercentoge= go)
System-out-priatln ("Grade
A"); ?
else if (penentcqe
> =8o Fpercentge 3o)
System.ovt>= phntn ("Grade b); 5,
eke i pexcentmge 7o ffpercntoge 2fo )
System.out println ("aGradec");
else if Percentaje >6 o ff, fercentage < To)
sstem, ovt Println("arade D") ;?
else if (percotge =4o tercetage < 6o)

system. ouk printla ("Grade e"); )


else
system out- Priatnl "GvadeF);

49 I-
op
length o sidet o riangle

evi lateral,jsocele) or scalere

Code
Poblic static Void main (sbrigE I ags)

SCanner

int A =
neo Scannerfmin)
Sc. next ntl)
;
int b Sc.next nt);
int C sc net nt();
5ystem out pratln ("€gvilateral Triangle;

dseit (A=B ll 6= =c ](A= =C


5ystem.out priat In ("Isoceles Tnangle");
else
system out prith("Salene Triange );}
.lo.IP: NJmber N
P- Based on divisiblity test.

Code:-
Public static Void main(SringLJangs

Canner Sc =new Scanner (5ystem. in)


int N Sc-next Int(.
if(N73=0N S O
Sstem.out println ("Gepal ");

elseif (NS:=0 fE,N,.3 !=o)


System.out Printh "Krishna" 5
elseif(Ny3==0_ O) NS krishna
Systam Out: Pirtln ("Gopal

.I. P
= unts
/ = elecmc bill
.
Code
Rublic stechic void main (StringL J ongs

SCanner 5c nëw Scannet (System,in);


int n SC.net Intl
int amt 0
fn=so
bill0 x O.S1
bill= bill +bill t0.2);
elseif (n>So fén<=ISo)
bill = 25+ Alh-5o)*0.75)
bill= bilt(bill *o.2];
elseif (h>150 =250 n
bill5+ 75 t(ln-156)x l.2)7
bill=bill+(ll&0-2); 3
selsef 220 +(0-250) 4|-5)
bill=

bill=bill+(bill xo-2);

System.0utprintIn (Math.flo(bill)

Q12 p :O,
olpwnlO), Lesel1)

Cade
Rblic stotic Void main (Shring
C) ogs

Camer Sc = new Scanner System-in)


int PP SL nextnt ()i
int ghost Sc. nextInt l);

iflpp
System 0ut-println
else
ghost=1)
" }3
7 ys tem but println ("o";3

You might also like