Programming question and answers

Here are some of the questions with their which might come to your thoughts while programming and believe me they are helpful. Some of these questions are even programming interview questions which are generally asked in interviews.


Ques 1. Why does the index in array starts with 0 and not 1 ?
           


Ques 2. With C arrays, why is a[5]==5[a] ?? (5 is just for an instance) ?
         


Ques 3. How to use two variables in for loop in C ?
         



Ques 4. How to print leading 0's in C ?
         



Ques 5. How to write a program to print "hello world" without using any semicolon in the program ?
         



Ques 6. How to swap two numbers without using a third variable ? (5 different ways of doing this)
         



Ques 7. How to change the value of a const declared variable in C ?
         



Ques 8. How to call a function before the execution of main function or after the execution of main function in a C program ?
         


Ques 9. How to find the size of a structure without using sizeof operartor in C ? 
         



Ques 10. How to add two numbers without using + operator or even without using any arithmetic operator ?
         



Ques 11. How to use #pragma directive in C ?
         



Ques 12.  What is the difference between calloc and malloc functions?
         





More questions to be added....

No comments:

Post a Comment