C Code Interview Questions
Questions Answers Views Company eMail

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

1 4045

#include main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }

1 4837

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

Hexaware,

3 14353

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

1 4928

main() { printf("\nab"); printf("\bsi"); printf("\rha"); }

3 30736

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

7 49326

#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

Google, HCL, Quick Heal, WTF,

4 35461

main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }

3 13166

#include #define a 10 main() { #define a 50 printf("%d",a); }

2 16122

#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }

2 18344

main() { 41printf("%p",main); }8

1 5040

main() { clrscr(); } clrscr();

2 4077

enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }

2 6692

void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }

2 7413

main() { int i=400,j=300; printf("%d..%d"); }

3 5905


Post New C Code Questions

Un-Answered Questions { C Code }

To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

514


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

6327


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

2032


write a program for area of circumference of shapes

2046


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

3705






How to palindrom string in c language?

8929


why nlogn is the lower limit of any sort algorithm?

2389


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.

3336


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.

2700


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3138


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.

2151


Write a routine to implement the polymarker function

4399


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

3162


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

1086


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.

2396