C Code Interview Questions
Questions Answers Views Company eMail

void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }

1 5190

int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }

1 8235

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }

IBM, TCS, UGC NET, Wipro,

29 44383

main() { int i=5; printf("%d",++i++); }

1 3665

main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }

1 5109

int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }

1 8108

main() { int i=5; printf(“%d”,i=++i ==6); }

1 10927

main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 16656

void ( * abc( int, void ( *def) () ) ) ();

1 6062

main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }

1 5264

main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }

1 5269

main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

CSC,

1 12123

void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }

1 5770

void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }

2 12743

main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

Adobe, CSC,

2 24323


Post New C Code Questions

Un-Answered Questions { C Code }

A program that will create a movie seat reservation. The program will display the summary seats and its status. The user will be ask what seat no. to be reserved, then it will go back again to the summary to display the updated seat status. If the seat no. is already reserved then it will prompt an error message. And also if the input seat no is out of range then it will also prompt an error message. The program is continuously running. Termination of the program will depends on how the programmer will apply. Sample output: Movie Seats Reservation Summary of Seats: Seat 1: Available Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1 Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 6 The Seat no. is out of range! Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1 The Seat no. is already reserved! Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 0 GoodBye... Thank You!!!

1850


write a simple calculator c program to perform addition, subtraction, mul and div.

3158


could you please send the program code for multiplying sparse matrix in c????

3078


How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.

1938


How can you relate the function with the structure? Explain with an appropriate example.

2925






how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

2147


Design an implement of the inputs functions for event mode

2970


Write a routine to implement the polymarker function

4389


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

3720


how to test pierrot divisor

2264


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2417


Cluster head selection in Wireless Sensor Network using C programming language.

3118


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

6319


Write a program to model an exploding firecracker in the xy plane using a particle system

3697


What is full form of PEPSI

1874