|
|
|
|
|
|
|
|
|
| Write a Program to print first n odd numbers. |
| Write a Program to accept a number and print the number in reverse order. E.g. if 1324 is the number then the output will be 4231. |
| Write a Program to accept a number and print sum of it’s digits. |
| Write a Program to accept a number and count the number of digits in that number. |
| Write a program to check whether a given Number is Palindrome or Not |
| Write a program to Check whether a given Number is an Armstrong Number or not. An Armstrong number is a number that is equal to the sum of its digits, each raised to the power of the number of digits in the number |
| Write a program to Check Whether given Number is Perfect or Not. A perfect number is a positive integer that is equal to the sum of its proper divisors, which are all of its positive divisors excluding the number itself. |
| Write a program to print table of a given number n. |
|
| Write a program to accept a number from user and print it’s factorial. |
| Write a program to accept a number from user and print if it is prime or not. |
| Write a program to accept a number and print prime numbers between 2 and n. |
| Write a program to find the Sum of all prime numbers from 1 to n. |
| Write a program to accept a number and print fibonacci series upto that level. |
Write a program to accept a number n from user and Add n terms of the series. 1/2! + 2/3! + 3/4! + 4/5! + 5/6! + ……… |
Write a program to accept a number from user and print that number in words but in reverse order. E.g. 153 -> THREE FIVE ONE |
| Write a program to create a list of integer numbers and print addition of all the elements of the list. |
| Write a program to create a list of integer numbers and print maximum and minimum element from that list. |
| Write a program to create a list of integer numbers. Now pick all the even numbers from that list and store them in evenList. And pick all the odd numbers from that list and store them in oddList. |
| Write a program to print day according to the day number entered by the user. |
Write a program to print the following sequence of integers. 0, 5, 10, 15, 20, 25
|
Write a program to find the Sum of following Series: (1*1) + (2*2) + (3*3) + (4*4) + (5*5) + ... + (n*n) |
Write a program to find the Sum of following Series: (1) + (1+2) + (1+2+3) + (1+2+3+4) + ... + (1+2+3+4+...+n) |
Write a program to find the Sum of following Series: [(1^1)/1!] + [(2^2)/2!] + [(3^3)/3!] + [(4^4)/4!] + [(5^5)/5!] + ... + [(n^n)/n!] |
| Write a program to find sum of even and odd numbers stored in a list. |
| Write a program to Print All the Repeated Numbers with Frequency in a list. |
| Write a program to Increment Every Element of the List by One & Print Incremented List. |
Jhon has sorted few confidential numbers in an array (array of int). To ensure that others do not find the numbers eassily, he has appiled a simple ecoding. Encoding used: Reverse the original array Each array element has been substituted with a value that is the sum of its original value and its succeeding element’s value. i.e. arr[i]= original value of arr[i] + original value of arr[i+1] i.e. also note that value of last element i.e. arr[last index] remains unchanged. |
Jhon Smith has been approached by the “techtomind society for kids” for help in generating the password. After listing the scenario, Smith realises that he will need a programmer’s support. Please help Smith by writing a function to generate the password. The scenario is as below- N- Numbers are available with the kids. These numbers are either stable or unstable. A number is stable if each of its digits occur the same number of times, i.e. the frequency of each digit in the number is same. For example: 112233, 1111, 4004, 12, 1010, 344366, 1010 are stable numbers. Similarly, a number is unstable if the frequency of each digit in the number is not the same. For example: 11233, 112, 1223, 101, 343 are unstable numbers. The password can be generating as: Password=sum of all stable numbers – sum of all unstable numbers For example: N=5 Numbers: 12, 1313, 122, 678, 898 Stable number: 12, 1313, 678 Sum_of_stable= 12+1313+678=2003 Unstable number: 122, 898 Sum_of_unstable=122+898=1020 Password= 2003-1020= 983 |
Write a function which accepts two integer number (Assume that both numbers are >=0) as arguments and adding both numbers from right to left one digit at a time. You need to calculate and return the total number carries generated while adding digits of two numbers. Example: Input: Number1: 675 Number2: 126 Output: 2 Note: 5+6 = 11 => carry 1 7+2+1(carry) = 10 => carry=1 6+1+1(carry) = 8 => No Carry |
Write program to generate the password which the sum of all possible palindrome numbers between given two numbers. For Example: Input: 10, 80 Output: 308 Explanation: All palindrome numbers between 10 & 80 are: 11,22,33,44,55,66,77 Password= 11+22+33+44+55+66+77 = 308 |
Tresesco Biswas has been approached by the “techtomind society for kids” for help in generating the password. After listing the scenario, Tresesco realises that he will need a programmer’s support. Please help of Tresesco by writing a function to generate the password. The scenario is as below- Kids want to generate a password an integer number with K digits. The password is a smallest K-digits number (None of the digits in password is 0) and the product of digits in password is greater than or equal to the sum of digits in password. For Examples: Input-1: K=3 Output-1: Password= 123 Input-2: K=4 Output-2: Password = 1124 Input-3: K=6 Output-3: Password = 111126 |
Write a method, wordReverser(), that will take a given string and reverse the order of the words and append the number of characters of that word at the end of the word. You may assume that the string is a sentence that contains only letters and spaces. For examples: Input-1 : "LearNowx rules" Outptu-1: "rules5 LearNowx8" Input -2: "May the Fourth be with you" Output-2: "you3 with4 be2 Fourth6 the3 May3" |
| Create a CountDigitOccurance() method that will take the number and digit as argument and return the number of times the given digit occurs. |
| Create a primeDigits(number) method that will return all the prime digits of an integer number. |
0 Comments