Trending ▼   ResFinder  

ICSE Prelims 2017 : 100+ super programs

8 pages, 131 questions, 96 questions with responses, 159 total responses,    1    0
Sai S Kalyan
Indian Institute of Technology (IIT) Madras, Chennai
B.Tech in Aerospace Engineering
+Fave Message
 Home > ved0_ssk_respaper_pongala >   F Also featured on: Group Page icse

Instantly get Model Answers to questions on this ResPaper. Try now!
NEW ResPaper Exclusive!

Formatting page ...

Write a program for the following, along with variable descriptions/mnemonics/comments 1. Check whether a number is prime-A number with only 1 and itself as its factors e.g.5 2. Check whether a number is composite-A number with factor(s) other than 1 and itself e.g. 6 3. Check whether a number is perfect-Equal to sum of factors other than itself e.g. 6 4. Check whether a number is special-Equal to the sum of factorials of its digits e.g.145 5. Check whether a number is Armstrong-Equal to the sum of cubes of its digits e.g.135 6. Check whether a number is odious-Contains odd number of 1s in binary form e.g. 5 7. Check whether a number is duck-Contains zeroes in it, not in the beginning e.g. 302 8. Check whether a number is disarium-Equal to the sum of digits raised to their positions from left e.g. 135 9. Check whether a number is IMEI-A 15 digit number which is divisible by the sum of last digit and twice the other 14 digits. e.g. 490154203237518 10. Check whether a number is twisted prime-a prime number whose reverse is also a prime number e.g. 13 11. Check whether a number is palindrome-Same as its reverse e.g.121 12. Check whether a number is automorphic-Contained in the last digits of its square e.g. 25 in 625 13. Check whether 2 numbers are amicable-Two numbers are amicable if the sum of factors of 1st number is equal to the 2nd and vice versa. 14. Check whether 2 numbers are coprimes-Are both prime and have only 1 as common factor. e.g. 23,29 15. Check whether a number is buzz number-Ends with 7 or divisible by 7 e.g. 67,177 16. Check whether a number is neon number-Equal to the sum of digits in its square e.g. 9, 9*9=81, 8+1=9 17. Check whether a number is valid ISBN- 10 digit no: such that sum of the 10 digits from left, multiplied by their respective positions, is divisible by 11 e.g. 14016014991+8+0+4+30+0+7+32+81+90=253, divisible by 11 18. Find the HCF and LCM of 2 numbers input by the user e.g. 15,25 HCF-5, LCM-75 19. Check whether a number is unique-a number whose digits are not repeated e.g. 12435 20. Check whether a number is happy number-The eventual sum of squares of digits should be 1 e.g. 28-22+82=68,62+82=100, 12+02+02=1 21. Check whether a number is a perfect cube e.g. 125=53 22. Check whether a number is a perfect square e.g. 25=52 23. Check whether a number is a niven number-divisible by sum of its digits e.g.126 24. Accept user s choice and display binary form of a decimal number for choice 1, decimal form of a binary number for choice 2. 25. Convert time input in 24 hour clock (military time) to time in 12 hour clock e.g. I/P-15:30 O/P-03:30 pm, I/P-07:24 O/P-07:24 am 26. Find the highest prime factor of a number e.g. I/P-12 , O/P-3 27. Find the middle digit of a number. If it does not exist find the average of middle digits e.g. I/P-33125 O/P-1, I/P-8974 O/P-8 (9+7/2) 28. Find the mean, median or mode of a set of numbers as per user s choice 29. Find the arithmetic mean [(a+b)/2], geometric mean [root ab] or harmonic mean [2ab/(a+b)] of a set of numbers as per user s choice 30. Display digits of a number in words using switch-case e.g. 298-Two Nine Eight 31. Display all twin primes less than n-Twin primes are primes differing by 2 e.g. 3,5 32. Display an input number to the base n e.g. I/P-10, to the base 2 O/P-1010 (binary form) 10/2=5, R=0, 5/2=2, R=1, 2/2=1, R=0, 1/2=0, R=1, In reverse order 1010 33. Display n terms of Fibonacci series -0,1,1,2,3.. 0+1=1,1+1=2,1+2=3 34. Display n terms of tribonacci series-1,1,2,4,7 1+1+2=4,1+2+4=7 35. Display n terms of repunit series-(10n-1)/9 36. Display n terms of mersenne series-2n-1 37. Display n terms of pell series-1,2,5,12,29.. 1+2*2=5,2+2*5=12 38. Display terms of 4n+1 series less than 100 39. Display n-factorial of an input number e.g. 2-factorial of 8=(8-2)*(8-4)*(8-6) 3-factorial of 15=(15-3)*(15-6)*(15-9)*(15-12) 40. Display tribonacci numbers between m and n e.g. 41. Find primorial of a number- product of prime numbers <= input number 42. Reduce the digits of an input number by 1 e.g. I/P-795, O/P-684 43. Sum of series- 2-4+6-8 n terms 44. Sum of series- x/2+x/5+x/8 n terms 45. Sum of series- a+a/2!+a/3! n terms 46. Sum of series- 2+(2*4)+(2*4*6) n terms 47. Sum of series- 2-4+6-8 n terms 48. Sum of series-x1/1!-x2/8!+x3/27!... n terms 49. Sum of series-x/1x2/4+x3/6 n terms 50. Sum of series-1/4+1/8+1/12 n terms 51. Sum of series-1/1!-2/2!+3/3!... n terms 52. Sum of series-1+1/1!+1/2!... n terms 53. Sum of series-x/1-x2/2+x3/3 n terms 54. Sum of series-(1+2)+(1*2)+(1+2+3)+(1*2*3) n terms 55. Sum of series-1+1/2+1/4 n terms 56. Sum of series-1+(1+2)+(1+2+3) n terms 57. Sum of series-x/y+2x2/y2+3x3/y3 2n-1 terms 58. Sum of series-x2!-x3!/2!+x4!/3!.... n terms 59. Sum of series-(1*2)+(2*3)+(3*4) n2 terms 60. Display a filled square with character ch and side n@@@@ @ @ @ @ @@@@ 61. Display55555 62. 63. 64. 65. 66. 67. 68. 69. 70. 54444 54333 54322 54321 DisplayEDCBA DCBA CBA B A A (for n terms) Display1 23 456 7 8 9 10 (for n terms) Display2 5 10 17 26 35 50 65 82 101 (for n terms) Displaya b c d e f b c a (for n layers of first triangle, here 3) DisplayA B B C C C (for n layers) Display1 11 111 1111 (for n lines) Display1 22 333 4444 (for n terms) Display1 12 123 1234 12345 (for n terms) Display1 71. 72. 73. 74. 24 135 2 4 6 8 (for n lines) Display a square of numbers1 2 3 4 3 6 9 12 n terms | n terms DisplayB BL BLU BLUE BLUEJ (for a string input here BLUEJ) Display1 121 12321 1234321 (for n lines) Display1 121 12321 121 1 (for n layers of first triangle, here 3) 75. Display* * * * * * * * * (for n layers of first triangle, here 3) 76. DisplayBLUEJ BLUE BLU BL B (for a string input here BLUEJ) 77. DisplayBLUEJ LUEJB UEJBL EJBLU JBLUE (for a string input here BLUEJ) 78. Display fibonacci number mod 10 to n terms0 11 2 3 5 79. DisplayABCDEDCBA ABCD DCBA ABC CBA AB BA A A (for n layers) 80. Display1 12 123 1234 12345 81. Display- 82. 83. 84. 85. 86. 87. 88. 89. 90. 0 01 024 0369 0 4 8 12 16 0 5 10 15 20 25 ( for n layers) Display in the following format: I/P-Best O/PC DD TTT SSSS Display a sentence in title case-convert first letter of each word to uppercase Input a string and display words beginning with caps and ending in small letters. Display the acronym of a sentence in uppercase e.g. I/P- This is beautiful. O/P-T.I.B. Arrange letters of a word input in uppercase in alphabetical order. Reverse the component words of an input sentence e.g. I/P-Click mouse over, O/P-revo esuom kcilC Display the sentences of an input string in reverse order- a sentence ends with any of the following- . ? ! Input a string and display in the format given: I/P-Computer Applications test O/P-RETUPMOC SNOITACILPPA TSET Calculate the frequency of each letter present in a string e.g. Committee C-1 E-2 I-1 M-2 O-1 T-2 91. Find the number of double letter sequences (FEED, APPLE) in an input sentence 92. Display the longest and shortest words of an input sentence 93. Check whether two input words are anagrams or not 94. Input two strings and display each string after removing common characters e.g. I/P- computer, calculator O/P- mpe, alla 95. Remove all repeated characters from an input string e.g. I/P- Computer Applications O/P-muerlns 96. Remove all duplicate characters form a string e.g. I/P- committee O/P- comite 97. Find the number of consecutive letter pairs in a number98. Replace a word of an input string with another input word e.g. I/P- Green goes Green Replace-Green Replace With-Red O/P-Red goes Red 99. Check whether a word is palindrome or not-same as its reverse e.g. MALAYALAM, CIVIC, MADAM 100. Display toggle case for a string-convert lowercase letters to uppercase letters and uppercase letters to lowercase letters in a string e.g. I/P-IndiA IS gReat O/P-iNDIa is GrEAT 101. Find the number of vowels in a string 102. Find piglatin form of a string-convert the string to uppercase, if a vowel is encountered, display characters from the vowel to last, then display the preceding characters of the first vowel and at the end add AY . e.g. I/P-London O/PONDONLAY, I/P-Universe O/P-UNIVERSEAY 103. Display initials of a name input e.g. I/P-Raja Ram Mohan Roy O/P-Roy, R.R.M. 104. Convert vowels to uppercase and consonants to lowercase in a string. 105. Input 20 names and sort them in alphabetical order using Bubble Sort. 106. Search for a number in an array of 15 numbers accepted from the user. 107. Input names of n cities and their STD codes, store them in two 1D arrays. Sort it using Selection Sort, display them along with STD code. 108. Accept two integer arrays of sizes m and n, merge them into a third array and display the third array. 109. Display the common characters of 2 strings 110. Display the words of an input sentence that have odd lengths 111. Accept n sentences in one array, store the number of words in each sentence in another array, and display the sentences in increasing order of number of words along with the number of words in each sentence. 112. Accept numbers from the user until a negative number is entered 113. Accept numbers from the user until a non-numeric value is input 114. Accept numbers from the user until a non-integral value is input. Compute the sum and product of the numbers and find the largest and smallest numbers. 115. Delete all occurrences of a number input by the user in an integer array and display the new array 116. Accept an array of names and insert an element input by the user at the specified position. Display the new array. Perform bubble sort on the array. 117. Accept the names of n students, their UIDs and percentage in Board exam and display them in the alphabetical order of names, order of UIDs or their marks as desired by the user. 118. Accept an array of n terms, split into an array of m terms (m<n) and another array containing the remaining (n-m) terms. 119. Define a class Caf . Initialise data members using constructors. Input the names of customers and the number of hours spent until a name is entered close . Calculate the day s collection on the rates: Rs10/hour for 1 hour or less, Rs 20/hour for 4 hours or less, Rs 30/hour for 6 hours or less, Rs 40/hour for more than 6 hours. 120. Define a class Booth. In order to find the number of literate and illiterate males and number of literate an illiterate females visiting the booth, accept gender( m for male and f for female) and whether literate or not( y for literate and n for illiterate) until the user inputs a space character. 121. Accept n values and their frequencies in 2 arrays and find the mean of the data 122. Find the number of vowels, consonants, numbers and other characters in each word of an input string. 123. Accept an array of numbers and a search item. Delete the first occurrence of the search item if found. 124. Accept a date from the user and validate it. 125. Find the number of possible anagrams of a word-Number of anagrams possible=Factorial of number of characters in the string converted to uppercase after removal of duplicate characters and spaces. e.g. A c t has 3!=6 anagrams 126. Find the angle between hour hand and minute hand of a clock after accepting the time from the user in hh:mm format and separating the hour and minute part from the string. Angle=Absolute value of 5.5m-30h Vintage programs 127. Initialise an array with the last ten years and accept the URL for CA in another array from the user. Ask a user to input a year and perform binary search. If not found, an appropriate message should be displayed. If found, display the URL along with the domain name, file name, file type and extension. e.g. www. respaper.com/icse2015-pdf.html Domain name-respaper.com File name-icse2015 File type-pdf Extension-html 128. Display an X-pattern of n lines, where n is odd. n3+n on principal diagonal arm (2,10,30,68,130-the middle term-here 30, belongs to this series), tribonacci series on other arm (0,1,2,3=>0+1+2=3,1+2+3=6 ) 2 0 10 1 30 2 68 3 130 (here n=5) 129. Overload a method mensuration to: (i)Find the perimeter of a square, circle and equilateral triangle (ii)Find the area of a rectangle, circle and equilateral triangle (iii)Find the volume of a cube, sphere, cone and cylinder Define another method to call the above methods according to user s choice 130. Store the primorial of first 10 composite numbers in one array. Store the factorial of first 10 prime numbers in another. Store the first 10 terms of pell series in a third array. Merge the three arrays into arr1[] and bubble sort it. Accept a word from the user and arrange its letters in alphabetical order using Selection Sort and store the sorted letters in an array arr2[]. Perform binary search for a number in the arr1[] or linear search for a character in arr2[] according to user s choice. 131. Define a class Electricity. Initialise required data members using constructors. Calculate electricity bill on the rates: Rs 1 per unit for first 100 units, Rs1.40 per unit on next 120 units, Rs 1.80 per unit for next 150 units and Rs 2.50 for remaining units. A meter rent of Rs 200 has to be paid and if more than 370 units are consumed a discount of 8% is allowed. An additional discount of 5% is provided on the balance. Compute net amount and display the details.

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


.

(24)

PHYSICIST_Mainak

(23)

RaBh

(18)

Saransh Srivastava

(13)

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2025 ResPaper. Terms of ServiceContact Us Advertise with us

 

ved0_ssk_respaper_pongala chat