[go: up one dir, main page]

0% found this document useful (0 votes)
429 views6 pages

Neopat Technical Week 3

Uploaded by

kratos10703
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
429 views6 pages

Neopat Technical Week 3

Uploaded by

kratos10703
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Duestion No :1/6 Whitelist

Ser : SCant printt

Single File Programming Question


Fill your code here c (7) v
Problem Statement
1 // You are using GCC
Alex is fascinated by number reoresentatons and needs a tool 2 #include<stdio. h>
to exp.ore thern. int main(){
int n;
scanf("%d", &n);
Developa program that
printf("In octal: %o \n", n):
LAsk Alex for a numeric vaiue printf("In hexadecimal: \n", n):
return 0:
2 Dispiays the entered number In octa and nexadecima
representatons using the respective tornat specitiers
Input format:
Theinputis asingieIntegern, reoresenting the numerical value
provided by Aiex

Output format:
The first line prints the octa representation ot the entered
number In the foliowingtormat in octa Octa value]
The second line prints the hexadecinai representation of the
entered number In thetolowingtorrnatin hexadecima
Hexadecimai vaiuel

Refer ta the samole outout far formattina sDecifications.


c (17) V
Question No: 2/6 FAll your code here

V/ You are using GCC


include< stdio.h>
Single File Programming Question int ain(){
float a, b:
scanf ("%f %",a, &b);
Problem Statement printf(" Before sMapping: %.2f %.2f\n",,b);
on yassqnment b=a-b;
Raja nceds a orog amn to swap va ues us rgtioatng point a=8-b;
printf("After sMapping: %.2f %.2f\n",a,b);
9
operators Wite a orogram that ta ces two 10
usina only
numbers a and Dasinout Swap the va ues
return 0:
11
betore and attcer the
assignment operators and d sooy then 12 }
sWap.

the corectness ot is
Can you ass st Raaincheciking
swapping orogram? I

Input format:
ue a rcoresentngtetirst
The tirst iine consists of atoat va
numoer
at.oot va ueb eoresentngtne
The seCond ne conssts ot
second numbe

Output format:
swapoing to owed by the vaiues
Tne firstine d'so ays Betore
betore swapping. sepaoted oy a
spgce wtn two decing
piaces Prev Ne
swopping fo owed oy tre Subrmit Code
The second line diso ays Atter
Compile & Run
Clear
Marcs: 10 Negative Mares0
Question No:3/6 Fll your code here Python.
9 You are using Python
dish_name- input()
Single File Programming Question restaurant_name=input()
4 rating-float (input ())
5 print (f"Dish Name: (dish_name)")
Problem Stotement 6 print (f"Restaurant: {restaurat_namey")
7 print (f"Rating: {rating: .1f}")
Zomato tracks tavor ted'shes In ts aD
tnat takes the
As a programme,you nave tO wr te o program
dish name, restaurant name. and rating and dispiays te
detais

input format:
name
The first line of inoutis a string reoresentngthe disn
restaurant name
The second lineisa sting representing the
The third line is afioat representng the at ng

Dutput format:
The first line of outout orints thedisn nane
The second lineprints trne restaurant name
decirna pace
The third line prints the rating tornatted to one

specifications.
Refer to the sample output for formatting
Code constraints :
Question No :4/6 Fllyour code here
1 #You areUsing Python
2- def print_reverse():
Single File Programming Question 3 floati - float(input ())
float2 = float(input())
integer = int(input ())
Problem Stotement 6 print("The values in the reverse order:")
7 print(integer)
Suppose you are bu dingafinancia app caton that helps 8 print(f"{float2:.2f}")
print (f"{float1:.2f")
users mnanage their investment Dotto os As Dat of this 9
1
application, you need to wr te a funct on thot gets the user s 11 print_reverse()
porttoo vaue aong wth the va ues ot three soecitc 12
Investments, asinputs The tuncto shou d tnen print the
vaiues in reverse orde
I
Write a Pytnon Drogram that get two toat ng DOnt nunbers
and an integer as inouts and Dnemin reverse order

nput format:
The first two lines of input consist of two fioating point numbers
The third line otinput consistsof ar intege
Dutput format:
The output dispiays the integer and the two footng point
mumbers in reverse orderas snown in the sanpie output
Python V
Question No: 5/6 Fill your code here

You are using Python


def display_climate_detai1s():
Single File Programming Question room_name-input()
temperature float (input () )
humidity-float (input ())
Problem Stotement print(f"Room: {room_name }")
print(f"Temperature: {temperature:.2f}")
humidity of print(f"Humidity: {humidity:.2f")
A smart home system traccs the temperature and display_climate_details()
each room Create a program that taikes the rOom name
10
(string). temoerature (t.oat), and num d'ty (toat)

Dispiay the roomsCimate detos

Input format:
the room
The first line of inout consists ot o string, representing
rame
the
The second ine consists of a tioot va ue, representng
ternpeature I
reoresenting the
The third line consists of a foat va ue.
humidity

Output format:
ternoerature, and nurnidity in
The output prints tne roorn name,
a tormatted sunmary
torrnatted to two decima
The temperature and hum dty are
places Pre
Compile &Run Subnit Code
uestion No:6/6 FIll your code here c (7) V
V/ You are using GCC
include<stdio.h>
single File Programming Question int main(){
int a,b, c;
scanf("%d %d %d", &a, b, lc);
Problem Stotement DrintsfH(D)-(a/b):
int
result of a + bc (a / b) is Sd\n",result);
ucas is a mathematcs enthusast eage to eNDiore the worid return 0;
of mathemat ca exoressions Create a simoeDrogram to
ssist Lucas in understanding the resutot a sDecitic
orithmetic expression The arog am shou d take three integers
of the exoression a
, b, andcasinout and ca cu ate te resut
+bc- (a/b) Dso ay the resut
nput formot:
separotedintegers,
he input consists of three space
epresenting a, b and c

Dutput format:
o o c (alo) is to owed
The output dispiays Tne resu't of
oy the resu't of the exoression

formatting specifications.
Refer to the sample output for the
Code constraints:
test coses ta under tre fol owing P
in the given scenario, the Cornpile & Run
Subrnit Code

Clear

You might also like