Starting Vocational Training From 1-May-2024 Get Detail


C language

Basic Input and Output
1.

Write a C program that accepts an employees ID, total worked hours of a month and the amount he received per hour. Print the employees ID and salary (with two decimal places) of a particular month. 
Test Data :
Input the Employees ID(Max. 10 chars): 0342
Input the working hrs: 8
Salary amount/hr: 15000
Expected Output:
Employees ID = 0342
Salary = U$ 120000.00


Solution
2.

Write a C program that accepts two item’s weight (floating points values ) and number of purchase (floating points values) and calculate the average value of the items.
Test Data :
Weight - Item1: 15
No. of item1: 5
Weight - Item2: 25
No. of item2: 4
Expected Output:
Average Value = 19.444444


Solution
3.

Write a C program that accepts two integers from the user and calculate the sum of the two integers.
Test Data :
Input the first integer: 25
Input the second integer: 38
Expected Output:
Sum of the above two integers = 63


Solution
4.

Write a C program to convert specified days into years, weeks and days. 

Note: Ignore leap year.

Test Data :
Number of days : 1329
Expected Output :
Years: 3
Weeks: 33
Days: 3


Solution
5.

Write a C program to compute the perimeter and area of a rectangle with a height of 7 inches. and width of 5 inches. 
Expected Output:
Perimeter of the rectangle = 24 inches
Area of the rectangle = 35 square inches


Solution
6.

Write a C program to print the following characters in a reverse way. 
Test Characters: X, M, L
Expected Output:
The reverse of XML is LMX


Solution
7.

Write a C program to print a block F using hash (#), where the F has a height of six characters and width of five and four characters. And also to print a big C. 
Expected Output:

######
#
#
#####
#
#
#
    ######
  ##      ##
 #
 #
 #
 #
 #
  ##      ##
    ######

Solution
8.

Write a C program to print your name, date of birth. and mobile number. Go to the editor
Expected Output:

Name   : Sensible Computers  
DOB    : July 14, 1995  
Mobile : 99-9999999999

Solution