C Code Interview Questions
Questions Answers Views Company eMail

main() { char *p; p="Hello"; printf("%c\n",*&*p); }

1 5257

main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }

1 4834

main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); }

2 14867

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

3 5606

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

3 5358

#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }

1 4859

main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }

IBM,

2 11376

#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 18313

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

Zoho,

1 20216

#include main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

CNSI,

2 11154

#include main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }

TCS,

1 7976

#include main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 10691

main() { extern int i; i=20; printf("%d",sizeof(i)); }

2 21318

main() { printf("%d", out); } int out=100;

3 11330

main() { extern out; printf("%d", out); } int out=100;

1 8949


Post New C Code Questions

Un-Answered Questions { C Code }

#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1060


how to test pierrot divisor

2246


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

2851


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2008


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

2397






In a gymnastic competition, scoring is based on the average of all scores given by the judges excluding the maximum and minimum scores. Let the user input the number of judges, after that, input the scores from the judges. Output the average score. Note: In case, more than two judges give the same score and it happens that score is the maximum or minimum then just eliminate two scores. For example, if the number of judges is 5 and all of them give 10 points each. Then the maximum and minimum score is 10. So the computation would be 10+10+10, this time. The output should be 10 because 30/3 is 10.

2368


why nlogn is the lower limit of any sort algorithm?

2364


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

3131


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

3061


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

2314


Write a routine to implement the polymarker function

4370


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

2909


3) Int Matrix of certain size was given, We had few valu= es in it like this. =97=97=97=97=97=97=97=97=97=97=97 1 = | 4 | | 5 | &= nbsp; | 45 =97=97=97=97=97=97=97=97=97=97=97 &n= bsp; | 3 | 3 | 5 | = | 4 =97=97=97=97=97=97=97=97=97=97=97 34 |&nbs= p; 3 | 3 | | 12 | &= nbsp; =97=97=97=97=97=97=97=97=97=97=97 3 | &nbs= p; | 3 | 4 | = | 3 =97=97=97=97=97=97=97=97=97=97=97 3 | = ; | | | = ; 3 | =97=97=97=97=97=97=97=97=97=97=97 &= nbsp; | | 4 | = ; | 4 | 3 We w= ere supposed to move back all the spaces in it at the end. Note: = If implemented this prog using recursion, would get higher preference.

3314


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

2669


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

6298