Initial Basics – Algebra – Problem #7

IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive

Difficulty: medium

Problem Statement

Submit one (single) C program. Write a C program to perform the following tasks. 1. Take as input the first 2 digits of your roll number. Let this number be a. 2. Next, take as input the next 2 characters of your roll number. 3. Then take as input the last 5 digits of your roll number. Let this number be b. 4. Print "Hello" followed by your full roll number. Eg. Hello 21CS10001. 5. Compute y = 1.234x105 +7.5x10-³ + b. 6. Print y. 7. Compute z = a+++ -b + b-. 8. Print a,b,z at the end of the computations. You may need to use math library function : #include imath.h If you want to compile useing the terminal then use the command gcc./program.c-Im Proper commenting, indentation and output commands carry marks.

Back to Lab Problems
Initial Basics/Algebra/Problem #7

Lab Problem Statement

Specifications & Problem DetailsIIT Kharagpur PDS Archive
Loading question...

Interactive C Compiler · Problem #7

WASM In-Browser

Runs directly on your machine · Zero remote server dependency

Compiler downloads on first Run (large, saved in your browser after that)
main.cCtrl + Enter to run
1
2
3
4
5
6
7
Input (stdin)given to scanf / cin
Output

Output appears here. Press Run to compile and execute.