You are on page 1of 1

1.

Write a program to accept the number of members in a family and the


number of days the family goes out for a trip. Assume all the family
members go for the trip. Calculate the bill for the trip as follows:
Number of days Rate
More than 5 less than equal to 8 Rs. 78,000/person

For more than 8 and less than equal to 12 Rs. 1,20,000/person

Calculate and display the bill. (15 M)

2. Write a program to find sum of all 3 digit even natural numbers.


(12 M)

3. Give the output and tell how many times the loop execute (2 M)
int i;
for(i = 7; i >7; i++)
System.out.println(i);
System.out.println(i*5);

4. Write a program to find the sum of the following series (15 M)


x! + (x + 2)! + (x + 4)! + …. + (x + 10)!
10 15 20 35

5. Find the error and rewrite after correcting the error (6 M)


a) if((2x + 5 = 10 && x > 0)
b) if(b < 10)
a++;
a*=2;
or
a--;
c) for(i=10, i <20, i++)

You might also like