Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

C Code Interview Questions
Questions Answers Views Company eMail

#include main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr 1 4023


Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

1 2452

main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

1 3148

main() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

1 5714

There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }

1 2918

Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])

1 4199

What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++ 1 3647


What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }

1 3136

What is the hidden bug with the following statement? assert(val++ != 0);

1 4068

void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

2 3569

#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }

1 5831

Is the following code legal? struct a { int x; struct a b; }

1 3037

Is the following code legal? struct a { int x; struct a *b; }

2 3017

Is the following code legal? typedef struct a { int x; aType *b; }aType

1 2975

Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };

1 3131


Post New C Code Questions






Un-Answered Questions { C Code }

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.

1722


Sir... please give some important coding questions asked by product companies..

1220


why nlogn is the lower limit of any sort algorithm?

1698


how to test pierrot divisor

1711


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

1410






How to palindrom string in c language?

6593


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.

1584


Write a routine to implement the polymarker function

3777


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

2516


write a program for area of circumference of shapes

1503


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

3219


Design an implement of the inputs functions for event mode

2334


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

2439


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

3556


Who could write how to find a prime number in dynamic array?

1560