Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1:
- Write a C program that read 5 numbers and sum of all odd values between them.
- Test Data :
- Input the first number: 11
- Input the second number: 17
- Input the third number: 13
- Input the fourth number: 12
- Input the fifth number: 5
- Expected Output:
- Sum of all odd values: 46
- # 2:
- Write a C program that prints all even numbers between 1 and 50 (inclusive).
- Test Data :
- Even numbers between 1 to 50 (inclusive):
- Expected Output:
- 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50
- # 3:
- Write a C program that accepts some integers from the user and find the highest value and the input position.
- Test Data :
- Input 5 integers:
- 5
- 7
- 15
- 23
- 45
- Expected Output:
- Highest value: 45
- Position: 5
- # 4:
- Write a program in C to display the pattern like right angle triangle using an asterisk.
- The pattern like :
- *
- **
- ***
- ****
- # 5:
- Write a C program to read temperature in centigrade and display a suitable message according to temperature state below :
- Temp < 0 then Freezing weather
- Temp 0-10 then Very Cold weather
- Temp 10-20 then Cold weather
- Temp 20-30 then Normal in Temp
- Temp 30-40 then Its Hot
- Temp >=40 then Its Very Hot
- Test Data :
- 42
- Expected Output :
- Its very hot.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement