ICSE SET 3
ICSE SET 3
(Theory)
(Two hours)
SECTION A (40 Marks)
Attempt all questions
Question 1
i) Differentiate between actual parameter and formal parameter with the help of examples [3]
ii) Give the output of the following
int x=5++<=--6?5:6;
System.out.println (x); [3]
Question 3
class outt
{
public void av( )
{
for(i=0;i<=10;i++)
{
if(i==6)
break;
}
System.out.println(a);
}
} [2]
Question 5
Input a sentence and a word; print the output after excluding that word from that sentence (if found).
Sample Input: Arghajyoti is very nice boy. His performance is very good so far.
Keyword: very
Sample Output: Arghajyoti is nice boy. His performance is good so far. [15]
Question 6
Write a program to display all DISARIUM numbers upto 2000. A number will be called DISARIUM if sum of its
digits powered with their respective position is equal with the number itself. [15]
e.g; 135 is a DISARIUM
(Workings 11+32+53 = 135, some other DISARIUM numbers are 89, 175, 518 etc)
Question 7
Input a number and and print the digits with the highest frequency. If more than one digit is having highest
frequency, all of them will be printed
e.g1 : input 212342
output Digit 2, frequency 3
e.g 2;
input 24542
output Digit 2, frequency 2
Digit 4 , frequency 2
[15]
Question 8
Input a sentence (sen), a word to search (srchwrd) and another word to replace (repwrd). Find the occurrence
of search keyword within the given string, finally display the sentence after replacing with the replace keyword.
Also display its occurrences in number. [15]
(Note it will search from every position within the string, even from middle of a word also)
Sample Input: Disari Public School is located in Haldia. It is co-ed residential cum day boarding School.
Search Keyword: is
Replace Keyword: IS
Sample Output : DISari Public School IS located in Haldia. It IS co-ed residential cum day boarding School.
Question 9
Display the output in the following pattern [15]
A B C D E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
(Remember, tab spaces are not there in reality)