C Interview Questions
Questions Answers Views Company eMail

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.

Yahoo,

5 18359

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

Microsoft,

1 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?

3 5122




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

6 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?

1 1850

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

TCS,

32 37430

WRITE A PROGRAM TO FIND A REVERSE OF TWO NO

7 6440




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

HCL,

2 3124

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

Trigent,

21 15168

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

IBM,

11 23539

who is the founder of c

HP, College School Exams Tests,

19 19714

Who is invented by c?

Mphasis, Infosys,

24 15241

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

4 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

3 3748


Post New C Questions






Un-Answered Questions { C }

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


At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with these names could be kept in that shelf as in this example: bottom of shelf ---> [AAAJKRDFDEWAAYFYYKK]-----Top of shelf. All these packets are to be loaded on cars. The cars are lined in order, so that the packet could be loaded on them. The cars are also named [A, B, C, D, E,………….]. Each Car will load the packet with the same alphabet. So, for example, car ‘A’ will load all the packets with name ‘A’. Each particular car will come at the loading point only once. The cars will come at the loading point in alphabetical order. So, car ‘B’ will come and take all the packets with name ‘B’ from the shelf, then car ‘C’ will come. No matter how deep in the shelf any packet ‘B’ is, all of the ‘B’ packets will be displaced before the ‘C’ car arrives. For that purpose, some additional shelves are provided. The packets which are after the packet B, are kept in those shelves. Any one of these shelves contains only packets, having the same name. For example, if any particular shelf is used and if a packet with name X is in it, then only the packets having names X will be kept in it. That shelf will look like [XXXXXXX]. If any shelf is used once, then it could be used again only if it is vacant. Packets from the initial shelf could be unloaded from top only. Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.

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