0% found this document useful (0 votes)
51 views6 pages

Sample - Programs Pps

The document contains a list of 88 programming problems ranging from basic mathematical operations and conversions to more complex problems involving prime numbers, Fibonacci sequences, calendars and combinations. The problems cover a wide variety of programming concepts including loops, conditionals, strings, arrays and more.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views6 pages

Sample - Programs Pps

The document contains a list of 88 programming problems ranging from basic mathematical operations and conversions to more complex problems involving prime numbers, Fibonacci sequences, calendars and combinations. The problems cover a wide variety of programming concepts including loops, conditionals, strings, arrays and more.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Programs List to be executed

1. Write a Program to add,multiply, subtract and division operations on the given two integers.
Inputs : a, b 45 34
Output
Addition is 45 + 34 = 79
Difference is 45 – 34 = 11
Multiplication is 45 * 34 =
Quotient is 45/34 = 1
Remainder is 45 % 34 = 11
Division is 45 / 34 = 1.24

Check for 5 9 , -9 5 , 9 -5 write your comments

2. Repeat the Above for Floating point variables without quotient and remainder
3. Write a Program to find the sum of first ‘n’ Natural Numbers
Sum= n (n+1) /2
Ex: input 4
Sum = 4 ( 4+1)/2 = 4*5 /2 =10
4. Write a Program to Convert Fahrenheit Temperature to celsius
C = 5/9 (f-32)

5. Write a program to find sum,difference,multiplication and division of the given two complex
numbers
Ex: First Complex Number a, b (RealPart + I imaginary Part)
Second Complex Number c, d (RealPart + I imaginary Part)

Addition - (a+c) and (b+d) (RealPart + I imaginary Part)


Difference  (a-c) and (b-d) (RealPart + I imaginary Part)
Multiplication
(a+ib) (c+id) = ac+iad+ibc+i2bd
That is ac-bd and ad+bc (RealPart + I imaginary Part)
Division (Rationalization)

6. Convert the given Minutes into Days, Hours and remaining Minutes
Ex: 2000

2000 minutes consists of 1 day 9 hours and 20 minutes


7. Find the sum of all digits in the given 4 digit integer.
8. Calculate the Starting week Day of an year if starting day of previous year is given. And no of
leap years are also given.
9. Calculate the Previous week day when weekday and no of previous days are given.
10. Calculate the net salary when basic is given
HRA=10% of Basic
PF=12% of basic
Da=128% of basic
Gross=basic+da+hra
Net=gross-pf
11. Interchange the values of two variables
12. Interchange the values of two variables without using the third variable
13. Find sum of squares first ‘n’ natural numbers
n(n+1)(2n+1)/6
14. Find sum of cubes first ‘n’ natural numbers
[n(n+1)/2]2
15. Convert the degrees into radians
r=d*3.1414/180;
16. Calculate the distance between two graph points (x1,y1) (x2,y2)
d=sqrt( (x2-x1)2+(y2-y1)2 )
17. Next term=k*present term (1-present term)
Take present term as -1 , then calculate next 5 terms
18. To print given number is even or odd by using ternary operator
19. Find the maximum and minimum when two values are given
20. When two integers are given check whether the second is a divisor of first or not
21. Find the maximum value when three variables are given
22. Find the minimum value when three variables are given
23. Find the maximum value when four variables are given
24. Find the minimum value when four variables are given
25. Find the roots of quadratic equation ax2+bx+c=0

±√
Roots = 𝑥 = Calculate separately when roots are imaginary

26. Check whether the given character is special symbol , digit or alphabet
27. Separate the given integer into position digits
6458 1s position digit is 8 , 10s position digit is 5 , 100s position digit is 4 and 1000s
position digit is 6
28. Write text for the given 1s position digit
1 one 2 two 3 three …….
29. Write text for the given 10s position digit and 1s position digit
30. To print the label according to the given age
0 - 3 Baby
4 - 10 Elementary School
11 - 15 High School
16 – 21 College
22 – 30 Learning Age
31 – 55 Young and Energitic
56 – 70 Knowledgeable Person
71 – 90 Old
91 – 120Great Person
31. To print week name when week no is given
32. To print month name when month no is given
33. To print given number is even or odd
34. To check whether the given year is a leap year or not
35. To display a statement with SNO for n times.
“WELCOME TO CPP” for n times
36. To find sum of all the numbers between the given two numbers
37. To find product of all the numbers between the given two numbers
38. To print the multiplication table of the given number
39. Find the sum of the squares of the numbers between the given two numbers
40. To find the Reverse Number of the given number
41. To check whether the given number is palindrome or not
42. To print all the factors given number n
43. To find the factorial of the given number n
44. To find npr and ncr
45. Find the GCD & LCM for the given two numbers
46. To print all the numbers between n1 and n2 which are divisible by d.
47. To check whether the given number is perfect or not
48. Print all perfect numbers between the given two numbers
49. To check whether the given number is prime or not
50. To print all prime numbers between the given two numbers
51. Find Fibonacci series below the given number n
52. Print all twin primes below the given number n
53. To check the given number is Armstrong or not
54. To print all the Armstrongs between the given two numbers
55. To check the given number is strong or not
56. To print all the strongs between the given two numbers
57. To find the digit sum of the given integer
58. To find the lucky number of the given integer
4538 4+5+3+8 = 20 = 2+0 = 2
59. To check whether the given number is HAPPY Number or not
60. To Print all happy numbers between the given two numbers
61. Exp(x)= 1 + + + +⋯
! ! !

62. Sin(x)= x − + +⋯
! !

63. Cos(x)= 1 − + +⋯
! !
64. to print all leap years between the given two years
65. to convert Decimal number to Binary System
66. To Convert Decimal to Octal
67. To Convert Decimal to Any system
68. To Convert Octal to Decimal
69. *
**
***
****
*****
70. *****
****
***
**
*

71. *
* *
* * *
* * * *
* * * * *

72. *
* *
* * *
* * * *
* * * * *
* * * * *
* * * *
* * *
* *
*
73. **********
**** ****
*** ***
** **
* *
74. 0
01
010
0101
01010

75. 0 0
01 01
010 010
0101 0101
0101001010

76. 12345
1234
123
12
1

77. 1
123
12345
1234567
123456789
78. 1 1
12 21
123 321
1234 4321
1234554321

79.
123454321
1234321
12321
121
1
80.

A
B C
D E F
G H I J
K L M N O
81.
1A2B3C4D5E
1A2B3C4D
1A2B3C
1A2B
1A
82.

A
ABA
ABCBA
ABCDCBA
ABCDEDCBA

83. Develop a calendar for an year when 1 st January week is


Given

84. To print Fibonacci Prime numbers below n


85. Convert the given integer rupees into text
86. Generate an integer by adding 1 to each digit for the given
integer. 9 is incremented to 0. Ex: 789 - 890, 123-234
87. To print all combinations of 0123
88. Find the maximum and minimum values when n values are given

You might also like