Você está na página 1de 3

C Programming Assignments Day 1

Assignments
Day #1:
Concepts: Formatted input/output, basic data types, type conversions

Estimated time: 1 Hour

Objective: At the end of the assignments, participants will be able to design the output
using escape sequences, to take input using proper format specifier as per the data type.
Also participants will be able to use type casting wherever necessary.

Problems:

1. Write a C program with appropriate comments at appropriate places to display the


following lines of text on screen:

Emp No Name Role\Designation

22000 Rajesh “Project Manager”

22100 Magesh “Team Leader“

22300 Amol “Sr. Software Engineer”, ‘System


Analyst’

2. Write a C program which accepts input for integer, character, float & double
data type identifiers from the user and prints the same on the screen. For each data
type consider all possible forms such as signed, unsigned, long etc wherever
applicable.

3. Write a C program to perform the following :


i. Multiplication
ii. Division.

Note .: Accept two inputs from the user during runtime, While doing the division
operation the program should print the quotient and the remainder in a formatted
way.
4. Write a C program to accept an input and print its corresponding ASCII value.

1/3
C Programming Assignments Day 1

Concept: Operators

Estimated time: 1.5 Hours

Objective: At the end of the assignments, participants will able to use different operators
with considering their precedence and associtivity.

Problems:

1. Write a C program to calculate the simple interest with following formula

Simple interest = (Principle Amount * No_Of_Years * Rate_Of_Interest


-----------------------------------------------------------------
100

Note : Accept Input for Principle_Amount, No_of_Years and


Rate_Of_Interest.

2. Write a C program which accepts radius as an input and find the area and perimeter of
the circle.

3. Write a C program to solve the quadratic equation.


Note: Accept necessary inputs to solve the equation.

4. Write a C program to accept two numbers during runtime and find the maximum
and minimum of the given two numbers using conditional or ternary operator.

5. Write a C program which accepts a character as an input and check whether the
entered input is an lower case, upper case or special symbol.

Concept: Conditional flow

Estimated time: 1.5 Hours

Objective: At the end of assignments, participants will able to implement conditional flow
using proper use of if-else or switch statements

Problems:

1. Write a C program which accepts four integer numbers and find the largest among the
four without using logical operator.

2. Write a C program which accepts selling price and cost price of an item during runtime
and determine whether the seller has made the profit or incurred loss and display the
output for the same.

2/3
C Programming Assignments Day 1

3. Write a C program to accept a number during the runtime and find whether it is even
or odd.

4. Write a program that accepts a number between 1 and 100 from the user. If there is a
coin of that value in cents, it should display its name. Otherwise, it should report that
there is no such coin
1 = cent, 5 = nickel, 10 = dime, 25 = quarter, 100 = dollar

5. Write a menu driven C program which accepts two numbers during runtime and
perform the following,

Menu
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Mod
and display the result according to selected menu option.

6. Write a C program which will accept an integer during runtime between 1 and 12 and
display the corresponding month for the accepted input and perform necessary
validations for the given input.

7. Write a program which will input the seconds and will convert it into minutes. For
example: If the input is 125seconds then the output should be 2 minutes and 5 seconds

8. Write a program which will accept the length in feet and display it in inches.
(1’ = 12’’)

9.

3/3

Você também pode gostar