Interview questions

C interview questions – page 52

2,094 questions. Tap “Show answer” to check yourself.

  1. Write a program that takes a 3 digit number n and finds outwhetherthe number 2^n + 1 is prime, or if it is not prime find out itsfactors.

  2. Can a structure inherit a class.

  3. How do you initialize a class member, class x {const int i;};

  4. What is shared inheritance

  5. What's a delegate?

  6. Can we inherit a private class in chsarp? how? explain(with code) ?

  7. Can multiple catch blocks be executed?

  8. Describe the accessibility modifier protected internal.

  9. How to write test cases for fibonacii series

  10. Can a structure used in a class if yes then how.

  11. Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

  12. Determine the code below, tell me exactly how many times isthe operation sum++ performed ?for ( i = 0; i < 100; i++ ) for ( j = 100; j > 100 - i; j--) sum++;

  13. Find the O/p of the following1)#includeint main(){ char c='1'; int j=atoi(c);}

  14. Int x=5;printf("%d%d%d",x,x<<2,x>>2);

  15. How to write aprogram by using array on queue

  16. Difference between over loading and over ridding?

  17. Class Program { void add() { int x=10, y=20; fun(); Console.WriteLine("{0}", sum); } void fun() { int sum; sum = x + y; } static void Main(string[] args) { Program f =new Program(); f.add(); } }Debug above program...

  18. Main(){ char c; int i = 456; clrscr(); c = i; printf("%d", c);}a. 456b. -456c. random numberd. none of the above

  19. Find string palindrome 10marks

  20. What are strin concatation methods in c#?

  21. Main(){static int ivar=5;printf("%d",ivar--);if(ivar)main();}

  22. What is the difference b/w abstract and interface?

  23. What is a hash function ?

  24. Write a function for strtok()?

  25. What are the storage class in C?

  26. Write a program to reverse a linked list?

  27. Why does not use getgh(); and <conio.h> in c language.

  28. Write a program to find the largest and second largest integer from an array

  29. Given an array of length N containing integers between 1 and N, determine if it contains any duplicates.

  30. How to write optimum code to divide a 50 digit number with a25 digit number?

Companies that ask C questions