SOFT Q
C HOME WORK
21 JUNE 2024
1. write a c program total worked hours in a month and the amount he
received
per hour Print salary of the employee for a particular month.
Example: input the working hrs: 8
amount/hr: 500
Expected Output: salary = 4000
2. write a c program to check whether a given number is positive or negative or zero.
Example: input: 15
Output: 15 is a positive number
3. input a single character and write a program to find out given character is special
character or not.
ROUGH WORK:
22 JUNE 2024
4. Write a c program to find sum of first 5 natural numbers 1+2+3+4+5.
(without using(n*n+1)|2)
5. Write a c program to print all uppercase and lowercase alphabets.
6. Writs a c program to find out product of first n natural numbers. 1*2*3*4*5*...*n.
ROUGH WORK:
23 JUNE 2024
7. Input 3 different integers find out biggest number in the given 3
numbers.
8. Write a c program to check whether a triangle can be formed with the given values
for the angles.
Example1: 40 55 65
Expected output: triangle is not valid(because sum is not equal to 180).
Example2: 55 75 50 triangle is valid
9. Write a c program to input a character and check whether the character is alphabet
or Not. (without using isalpha()).
10. Write a c program to check whether a number is divisible by 5 and 11 or not.
(using if else).
11. Write a c program to check whether an alphabet is vowel or consonant (using if
else).
12. Write a program to check whether a person is eligible for voting or not.
(accept the age through scanf).
13. Write a program to check whether a number is divisible by 7 or not.
14. Write a program to display “Soft Q” if a number entered by user is a multiple of five,
Otherwise print “Bye”.
15. Write a program to check whether the last digit of a number(entered by user
through Scanf) is divisible by 5 or not.
16. Write a program to check whether a number entered is three digit number or not.
17. Accept the following from the user and calculate the percentage of classes
attended.
a) Total number of working day
b) Total number of days for absent
After calculating percentage show that, show that if the person is less than 75
than student will not able to sit in exam.
18. input any single character and write a program to find out given character is special
Character or not.
ROUGH WORK:
25 JUNE 2024
19. Write a C program to enter month number between(1-12) and print number of days
in Month.
Example:
Input: Enter month number:1
Output: It contains 31 days.
Write a c program to input cost price and selling price of a product and check profit
or Loss. Also calculate total profit
Note: If cost price is greater than selling price then there is a loss otherwise profit
20. write a c program to input week number(1-7) and print the corresponding day of
week Name. using if else if
Example:
Input: Enter month number:
Output: It contains 31 days
ROUGH WORK:
26 JUNE 2024
21. Write a c program to input electricity unit charge and calculate the total electricity
bill according to the given condition:
For first 50 units Rs. 0.50/unit
For next 100 units Rs. 0.75/unit
For next 100 units Rs. 1.20/unit
For units above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill.
22. Write a c program to input basic salary of an employee and calculate gross salary
according to given conditions.
Basic salary is <=10000:HRA=20%,DA=80%
Basic salary is between 10001 to 20000:HRA=25%,DA=90%
Basic salary >=20001:HRA=30%,DA=95%
HRA means: house rent allowance
DA means: Dearness allowance
Note: flow chart in next page
27 JUNE 2024
23. Write a c program to input week number(1-7) and print the corresponding day of
week name using switch
Example
Input: week number :1
Output: Monday
24. Write a c program to enter month number between(1-12) and print number of days
in month. Using switch statement
Example
Input: enter month number: 1
Output: it contain 31 days
25. Write a c program to calculation that performs basic arithmetic operations (1-add, 2-
subtract, 3-multiply and 4-divide) using switch
The program should input two numbers and an operator from user. It should
perform operation according to the operator entered.
ROUGH WORK:
29 JUNE 2024
26. Write a c program to count the total number of digits in a number
using while loop.
For example: the number is 75869, so the output should be 5
27. Write a c program to accept a number from a user and calculate the sum
of all numbers from 1 to a given number.
For example: if the user entered 10 the output should be
55(1+2+3+4+5+6+7+8+9+10).
28. Write a c program to print all even numbers from 1 to n using while
loop. C program to generate all even numbers between given range.
Example:
Input
Input: upper range:10
Output: even numbers between 1 to 10: 2,4,6,8,10
29. Input any integer number and write a program to find out smallest digit
in the given integer number.
For example the number 7159, so the out put should be 1.
1 JULY 2024
30. Write a program in c to read 10 numbers from the Keyboard and find
their sum and average Using for loop.
31. Calculate the cube of all numbers from 1 to a given number.
Input: 3
Output:
No Cube
1 1
2 8
3 9
32. Use for loop to generate a list of numbers from 9 to 50 divisible by 2.
2 JULY 2024
33. Write a c program, to count frequency of digits in a given
number. How to find frequency of digits in a given number using do…
while loop in c programming.
Example
Input:
Input any number: 786
Output:
Frequency of 0=0
Frequency of 1=0
Frequency of 2=0
Frequency of 3=0
Frequency of 4=0
Frequency of 5=0
Frequency of 6=1
Frequency of 7=1
Frequency of 8=1
Frequency of 9=0
34. C program to check whether the input number is a Neon
Number
(i.e. a number where the sum of digits of the square of the number is
equal to the number) return “true” or “false” accordingly.
Example:
Input: number =9
Output: true
Explanation: square of 9 is 9*9=81, sum of digit of square is 8+1=9
(i.e equal to given number).
Input: num= 10
Output: false
Explanation: Square of 10 is 10*10=100, sum of digit of square is
1+0+0=1(i.e. not equal to given number).
35. Write a program print the following pattern
ABC
DEF
GHI
36. Write a program to print the above pattern
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25