Monday, August 27, 2007

Programming Questions-Set-I,Zephyrix'07

1.Find whether the given no is even or odd without using conditional operator and conditional statements and math functions

2. Swap two given numbers without using a temporary variable and arithmetic operations

3.Evaluate the expression (a+b)(a-b) without using ‘+’ operator and math function

4. Write a program to display the following output:

*
**
***
****
*****

5.What is meant by dangling pointer?

6. Write a program to check whether the given no is prime no or not

7.Write a snippet to find the gcd of two given nos

8.Write a simple program to display the system time.

9. Convert a character from one case to the other.

10. Write a single line statement to initialize all elements on an array to 0 using a single assignment.

11. Write a recursive function to find the nth term of the fibonacci series.

12. The Illustrated Books Of African Animals has photos of various animals on the left side and the description of the animal on the right. Given a random page number, write a function to predict if the page has pictures or description. The first page contains the introduction describing the various geographics regions in the area.

13. The Schema Occult group celebrates a special function every four years with certain exceptions. This custom was started 1492. But due to some vague reasoning they did not celebrate it in the year 1500. You, being the Leader of this group has to take into account these factors and make the Master Computer find if the current year is fit to be celebrated.

14. You are a railways employee. Your job is to print the list of passengers to be stuck on the compartments. When the Rajdhani Express arrived at the station, you notice that the list you printed was wrong. The names in the list seemed garbled except for a couple of people. Those two people were ‘Healaeh’ and ‘Arora’. You have 5 minutes to write a program to sort out the error and print the correct list.

15. A king decides to execute 100 prisoners and arranges them in circular fashion. The first prisoner is given the sword. He kills next prisoner and passes the sword to the next prisoner and the process continues. You have to save two prisoners. Write a C program to find the two positions for the prisoners to be alive.

2 comments:

Unknown said...

good da.....

It would be nice if u post the answers too for these questions

Unknown said...

15th question super da....