Escolar Documentos
Profissional Documentos
Cultura Documentos
Assignments
Day #1:
Concepts: Formatted input/output, basic data types, type conversions
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:
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.
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
Objective: At the end of the assignments, participants will able to use different operators
with considering their precedence and associtivity.
Problems:
2. Write a C program which accepts radius as an input and find the area and perimeter of
the circle.
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.
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