C Interview Questions
Questions Answers Views Company eMail

what is the difference between getch() and getchar()?

Infosys, Huawei,

10 23070

what is the use of getch() function in C program.. difference b/w getch() and getche()??

IBM, Wipro, Infosys, TCS, HCL,

29 68984

how to implement stack work as a queue?

2 3858




write a c programs to do multiplication of two numbers with out using arithmatic operator ??????????

Infosys, TCS,

7 16064

what is the differnce between AF_INET and PF_INET?

Wipro, Systems Plus,

5 23687

1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?

746

9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro?

1 1777

15.what is the disadvantage of using macros? 16.what is the self-referential structure? 17.can a union be self-referenced? 18.What is a pointer? 19.What is the Lvalue and Rvalue? 20.what is the difference between these initializations? 21.Char a[]=”string”; 22.Char *p=”literal”; 23.Does *p++ increment p, or what it points to?

1 2723




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?

684

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?

708

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?

3 3809

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?

9 5818

1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?

nvidia,

2 4510

9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro?

L&T,

4 5517

15.what is the disadvantage of using macros? 16.what is the self-referential structure? 17.can a union be self-referenced? 18.What is a pointer? 19.What is the Lvalue and Rvalue? 20.what is the difference between these initializations? 21.Char a[]=”string”; 22.Char *p=”literal”; 23.Does *p++ increment p, or what it points to?

CTS,

2 8471


Post New C Questions






Un-Answered Questions { C }

pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

1377


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

1107


Without Computer networks, Computers will be half the use. Comment.

955


Using which language Test cases are added in .ptu file of RTRT unit testing???

1293


Simplify the program segment if X = B then C ← true else C ← false

1775






int i=10; printf("%d %d %d", i, i=20, i);

19


difference between Low, Middle, High Level languages in c ?

807


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

800


Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent

628


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

783


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

857


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); } }

936


write an interactive C program that will encode or decode a line of text.To encode a line of text,proceed as follows. 1.convert each character,including blank spaces,to its ASCII equivalent. 2.Generate a positive random integer.add this integer to the ASCII equivalent of each character.The same random integer will be used for the entire line of text. 3.Suppose that N1 represents the lowest permissible value in the ASCII code,and N2 represents the highest permissible value.If the number obtained in step 2 above(i.e.,the original ASCII equivalent plus the random integer)exceeds N2,then subtract the largest possible multiple of N2 from this number,and add the remainder to N1.Hence the encoded number will always fall between N1 and N2,and will therefore always represent some ASCII character. 4.Dislay the characters that correspond to the encoded ASCII values.  The procedure is reversed when decoding a line of text.Be certain,however,that the same random number is used in decodingas was used in encoding.

1484


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1019


what are bit fields? What is the use of bit fields in a structure declaration?

719