C Interview Questions

There is a 100-story building and you are given two eggs. The eggs (and the building) have an interesting property that if you throw the egg from a floor number less than X, it will not break. And it will always brake if the floor number is equal or greater than X. Assuming that you can reuse the eggs which didn't broke; you got to find X in a minimal number of throws. Give an algorithm to find X in minimal number of throws.

18359

Given an array of characters, how would you reverse it? How would you reverse it without using indexing in the array?

7657

Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?

5122

Concat two string with most overlapped substring has to remove  "abcd"+ "cdef" = "abcdef

5994

Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon

HCL,

1003

what r the cpu registers r ther?

1850

printf("%d",(printf("Hello")); What it returns?

TCS,

37430

WRITE A PROGRAM TO FIND A REVERSE OF TWO NO

6440

what is diff between localstatic and globalstatis variable possible 2 use in another file...?

HCL,

3124

what is op? for(c=0;c=1000;c++) printf("%c",c);

15168

in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?

IBM,

23539

who is the founder of c

19714

Who is invented by c?

15241

To what value do nonglobal variables default? 1) auto 2) register 3) static

6426

Would you rather wait for the results of a quicksort, a linear search, or a bubble sort on a 200000 element array? 1) Quicksort 2) Linear Search 3) Bubble Sort

3748

how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

732

Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

928

1060

Which is the memory area not included in C program? give the reason

851

c language interview questions & answer

781

write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

1722

1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

2019

In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

2016

hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

763

largest Of three Number using without if condition?

272

Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS\$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS\$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include #include #include #include int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }

934

i got 75% in all semester am i eligible for your company

1087

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

1891

c program to compute AREA under integral

1058

write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

751