Will this code cause an error during runtime, error during compilation, or no error? 1.) char str[5]; strcpy (str, "hello"); 2.) char *str; strcpy (str, "hello");
Latest Answer: Both will give segmentation fault.For first str[6] is required and for second we have to do malloc for pointer ...
Explain srand() and rand() Functions
If we add a element to the last of a sorted sequence. Then which of the sorting method will be most efficient to sort the new sequence?
Latest Answer: I think radix sorting would be more perfect in case of large sequence of elements as because it will reduce the no. of elements to be compared to a minimal. As it goes on to check the inserted element wid the center of the sequence and rules out ...
How will you find the number of occurrences of a particular string in the given input string?
Latest Answer: int computeSubStrings(const char *string,const char *substr){ int count = 0; char *token = strstr(string,substr); while(token != NULL) { count++; token = strstr(token + 1,substr); } return count;}The above function can be used for counting no. of occurences ...
Explain How Terminate & Stay Resident (TSR) and Offline programming differ from one another.
Latest Answer: TSR stands for Terminate- and Stay-Resident programs.TSR are programs which get loaded in memory and remain or stay there (resident) in memory permanently. They will be removed only when the computer is rebooted or if the TSR is explicitly removed from ...
How will you execute a file from another C program through C programming without system command?
Latest Answer: The question here asks "how to run another progam without using a system call". I do not think it is possible to run another program without using exec. ...
printf("%d%d",f1(),f2());What is the sequence of function execution of the above statement. 1. printf, f1(), f2()2. printf, f2(), f1()3. f1(), f2(), printf4. f2(), f1(), printf.
Latest Answer: Many has provided correct answer.The Best way is to examine the assembly code. printf("This is printf()n", f1(), f2());// CALL f2000213DE call f2 (21091h) 000213E3 mov ...
Base class has some virtual method and derived class has a method with the same name. If we initialize the base class pointer with derived object, calling of that virtual method will result in which method
Latest Answer: As explained, you have assigned the base class pointer to the derived class object, the derived class method will get called. ...
Write a C programme that read 30 integer numbers into one dimension array then using a function to sort them in desinding order (this function should use another function to exchange any two elements int
Latest Answer: Hi , Let break the question into three parts 1-Read 3o intgers and store them in one dimensional array. 2. Write one function to sort them in descending order.Let ...
Write the implementation of Fix function? fix(2.5) = 2 and fix(-2.25) = -3, this is the expected result. Write the code to implement this behaviour?
Latest Answer: int fix(float f1){ return(floor(f1));} ...
View page [1] 2 3 4 5 6 7 8 9 10 Next >>

Go Top