C Interview Questions
Questions Answers Views Company eMail

Difference between Shallow copy and Deep copy?

901

#include void main() { char *str; long unsigned int add; str="Hello C"; add=&str[0]; printf("%c",add); } What is the output?

Infosys,

4 5612

hello everybody can we change a the adress of a variabl i mean can i put for exemple for a int *p: &p=6 ?????????

1 1924




please send me the code for multiplying sparse matrix using c

1081

what is diference between return 0 and return NULL??

3 3054

#include void main() { int a=5,b=6,c; int x=(a

IBM,

8 8831

What are pointers in C?

KPIT,

5 4062

what is difference between #include and #include"stdio.h"

4 3477




how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

2087

Write a function that accepts a sentence as a parameter, and returns the same with each of its words reversed. The returned sentence should have 1 blank space between each pair of words. Demonstrate the usage of this function from a main program. Example: Parameter: “jack and jill went up a hill” Return Value: “kcaj dna llij tnew pu a llih”

Mind Tree,

5 13042

Explain this code. #include void f1(int *k) { *k = *k + 10; } main ( ){ int i; i = 0; printf (" The value of i before call %d \n", i); f1 (&i); printf (" The value of i after call %d \n", i); }

IBM,

3 2282

LOGIC OF Bodmas?

1 6309

main() { int i = -3,j=2,k=0,m; m= ++i || ++j && ++k; printf("%d%d%d",i,j,k,m); }

HCL,

6 13196

define c

TCS, HCL,

6 4075

what is C?

Syntel,

9 5067


Post New C Questions






Un-Answered Questions { C }

please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

844


which is an algorithm for sorting in a growing Lexicographic order

717


How to delete a node from linked list w/o using collectons?

1428


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

2929


Can you write the algorithm for Queue?

869






Without Computer networks, Computers will be half the use. Comment.

1084


develop algorithms to add polynomials (i) in one variable

1023


Explain the process of converting a Tree into a Binary Tree.

1267


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

960


write a program to copy the string using switch case?

1717


I need help with the following lab. Can anyone explain it to me on how to approach this problem. Coding would be great too !!! No busy waiting allowed. Remember that Java monitors are 'signal and continue'. The input data is called the database (DB). In this problem, it consists of a single variable initialized in the main thread, to contain the current time of day in HH:MM:SS:mmm format (mmm is milliseconds) truncated to 3 digits. Threads follow these rules: 1. Readers may all attempt to read at the same time, but NOT if a writer is writing (i.e.; the writer is in the monitor. 2. Writing is exclusive (only 1 writer at a time, no readers while writing). 3. Options: (to be specified by instructor) a. Readers have absolute priority over writers. b. Writers have absolute priority over readers c. When a reader arrives and a writer is waiting, the reader is suspended behind the writer instead of being admitted immediately. Thus, a writer waits for readers that were running when it arrived, but does not to wait for new readers. You may program this in C++ or Java. There are 4 controlling input values: 1. r – number of readers 2. w – number of writers 3. R – delay for a reader to restart 4. W – delay for a writer to restart Create the following program consisting of 1 main process (your main program) with n threads: 1. The main thread: a. Creates the 'n' threads needed. Of these, r of them are readers and w of them are writers. Starts all readers and writers. b. Waits for all 'n' threads to complete. You may use any method to detect when they are all complete. c. Prints out the resulting outputs from the threads. 2. Threads: a. When a thread starts to run, it immediately tries to enter the monitor. b. A reader thread reads the DB, outputs the exact message below, then exits: >>> DB value read =: HH:MM:SS:mmm by reader number: rr where the underlined text is replaced with actual data. c. A writer thread updates the DB with a new value (from the system time), outputs the exact message below, then exits: *** DB value set to: HH:MM:SS:mmm by writer number: ww where the underlined text is replaced with actual data. d. Each thread accesses the data a total of 10 times, exiting, then re-entering the monitor after each access. Hints: 1. File access *might* not be thread-safe, so you should be prepared to handle this. Read the documentation for the language you are using. 2. Suggested values for delays are: a. If looping, R >=1,000,000 and W>=100,000 b. If using “sleep”, then R=100 ms, W=50 ms. Additional: • Thread output is to ONE file used by ALL threads (so you need to synchronize access to it). • Readers must provide sufficient delay that results are useful (delay by R before re-trying). R is another input value. • Writers must also delay. Delay by W, updating the DB each time. W is an input. • Test your program with AT LEAST TWO different sets of values for r and w (#s of readers and writers) plus this set: r = 4, w=2. Basic operation of a thread: attempt to enter the monitor. If unsuccessful, you get put on a queue. When you get in, read or write the data (depending on type of thread), exit the monitor, wait the required delay amount, then try again. Repeat 10 times.

809


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

1804


c program to compute AREA under integral

1058


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

777


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

264