C Interview Questions
Questions Answers Views Company eMail

24.what is a void pointer? 25.why arithmetic operation can’t be performed on a void pointer? 26.differentiate between const char *a; char *const a; and char const *a; 27.compare array with pointer? 28.what is a NULL pointer? 29.what does ‘segmentation violation’ mean? 30.what does ‘Bus Error’ mean? 31.Define function pointers? 32.How do you initialize function pointers? Give an example? 33.where can function pointers be used?

2 7829

34.what are bitwise shift operators? 35.what are bit fields? What is the use of bit fields in a structure declaration? 36.what is the size of an integer variable? 37.what are the files which are automatically opened when a c file is executed? 38.what is the little endian and big endian? 39.what is the use of fflush() function? 40.what is the difference between exit() and _exit() functions? 41.where does malloc() function get the memory? 42.what is the difference between malloc() and calloc() function? 43.what is the difference between postfix and prefix unary increment operators?

3 3884

44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?


6 6800

52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?

Solartis, TCS, Datamatics, ThinkBox, Trine,

25 42035

Given an array A[n+m] of n+m numbers, where A[1] ... A[n] is sorted and A[n+1] ... A[n+m] is sorted. Design a linear time algorithm to obtain A[1...n+m] sorted using only O(1) extra space. Time Complexity of your algorithm should be O(n) and Space Complexity O(1).


What is meant by int fun const(int a, int b) { .... ... }

1 3617

How can I get Single byte from 'int' type variable? Can we alter single bit or multiple bits in int type variable? if so, How?

2 5178

Can we access RAM? How? Whats the range of access? Similarly What are other hardware we can access?

1 2262

Which command is more efficient? *(ptr+1) or ptr[1]

3 3968

Function to find the given number is a power of 2 or not?

nvidia, Motorola,

20 31888

Program to write some contents into a file using file operations with proper error messages.

2 3302

how to find that no is int or float?

5 5310

can we access one file to one directory?

1 2278

will u give me old quesrion papers for aptitude for L & t info tech?

L&T, Hindustan,

1 3860

Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.

2 4242

Post New C Questions

Un-Answered Questions { C }

Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.


write a program to create a sparse matrix using dynamic memory allocation.


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel


char *p="name"; printf(p);


can any one tel me wt is the question pattern for NIC exam


What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.


Why is event driven programming or procedural programming, better within specific scenario?


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions




how to write optimum code to divide a 50 digit number with a 25 digit number??


Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }