Advertisement
Sabbir-bin

Some problem in C program. solve it

Sep 9th, 2019
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.24 KB | None | 0 0
  1. # 1:
  2. Write a C program that read 5 numbers and sum of all odd values between them.
  3.  
  4. Test Data :
  5. Input the first number: 11
  6. Input the second number: 17
  7. Input the third number: 13
  8. Input the fourth number: 12
  9. Input the fifth number: 5
  10.  
  11. Expected Output:
  12. Sum of all odd values: 46
  13.  
  14. # 2:
  15. Write a C program that prints all even numbers between 1 and 50 (inclusive).
  16.  
  17. Test Data :
  18. Even numbers between 1 to 50 (inclusive):
  19.  
  20. Expected Output:
  21. 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
  22.  
  23. # 3:
  24. Write a C program that accepts some integers from the user and find the highest value and the input position.
  25.  
  26. Test Data :
  27. Input 5 integers:
  28. 5
  29. 7
  30. 15
  31. 23
  32. 45
  33.  
  34. Expected Output:
  35. Highest value: 45
  36. Position: 5
  37.  
  38. # 4:
  39. Write a program in C to display the pattern like right angle triangle using an asterisk.
  40.  
  41. The pattern like :
  42.  
  43. *
  44. **
  45. ***
  46. ****
  47.  
  48. # 5:
  49. Write a C program to read temperature in centigrade and display a suitable message according to temperature state below :
  50.  
  51. Temp < 0 then Freezing weather
  52. Temp 0-10 then Very Cold weather
  53. Temp 10-20 then Cold weather
  54. Temp 20-30 then Normal in Temp
  55. Temp 30-40 then Its Hot
  56. Temp >=40 then Its Very Hot
  57.  
  58. Test Data :
  59. 42
  60.  
  61. Expected Output :
  62. Its very hot.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement