C Interview Questions
Questions Answers Views Company eMail

what is the difference between. system call and library function?

Satyam, CDAC,

2 16525

struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator??

Verifone,

9 9127

what is diff b/w huge & far & near pointer??

HCL,

1 2412




write a function for strtok()??

Verifone,

2 7655

what is the output of the following program and explain the answer #include exp() { main(5) } main(int a) { printf("%d",a); return; }

Satyam,

3 3305

what is difference b/w extern & volatile variable??

Teleca,

6 9324

what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

Satyam, Gamesa,

1099

design and implement a program that reads floating-points numbers in a sentinel-controlled loop until the user terminates the program by entering zero.your program should determinate and print the smallest,largest and average of the supplied numbers.

2 3463




i want to have a program to read a string and print the frequency of each character and it should work in turbo c

Wipro, Persistent,

3 6205

here is a link to download Let_Us_C_-_Yashwant_Kanetkar

Microsoft,

3 7773

How do you write a program which produces its own source code as its output?

2 3164

what is the importance of spanning tree?

811

How to reverse a string using a recursive function, with swapping?

5 4724

How to Clear last bit if it 1 using Macro TURN_OFF_BIT_LAST

Adobe, Huawei,

6 7133

what is pointer

TCS,

1 2563


Post New C Questions






Un-Answered Questions { C }

what is the basis for selection of arrays or pointers as data structure in a program

3017


Wt are the Buses in C Language

2012


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

1896


Agonistic behavior, or aggression, is exhibited by most of the more than three million species of animals on this planet. Animal behaviorists still disagree on a comprehensive definition of the term, hut aggressive behavior can be loosely described as any action that harms an adversary or compels it to retreat. Aggression may serve many purposes, such as Food gathering, establishing territory, and enforcing social hierarchy. In a general Darwinian sense, however, the purpose of aggressive behavior is to increase the individual animal’s—and thus, the species’—chance of survival. Aggressive behavior may he directed at animals of other species, or it may be conspecific—that is, directed at members of an animal’s own species. One of the most common examples of conspecific aggression occurs in the establishment and maintenance of social hierarchies. In a hierarchy, social dominance is usually established according to physical superiority; the classic example is that of a pecking order among domestic fowl. The dominance hierarchy may be viewed as a means of social control that reduces the incidence of attack within a group. Once established, the hierarchy is rarely threatened by disputes because the inferior animal immediately submits when confronted by a superior. Two basic types of aggressive behavior are common to most species: attack and defensive threat. Each type involves a particular pattern of physiological and behavioral responses, which tends not to vary regardless of the stimulus that provokes it. For example, the pattern of attack behavior in cats involves a series of movements, such as stalking, biting, seizing with the forepaws and scratching with tile hind legs, that changes very little regardless of the stimulus—that is, regardless of who or what the cat is attacking. The cat’s defensive threat response offers another set of closely linked physiological and behavioral patterns. The cardiovascular system begins to pump blood at a faster rate, in preparation for sudden physical activity. The eves narrow and the ears flatten against the side of the cat’s head for protection, and other vulnerable areas of the body such as the stomach and throat are similarly contracted. Growling or hissing noises and erect fur also signal defensive threat. As with the attack response, this pattern of responses is generated with little variation regardless of the nature of the stimulus. Are these aggressive patterns of attack and defensive threat innate, genetically programmed, or are they learned? The answer seems to be a combination of both. A mouse is helpless at birth, but by its l2th day of life can assume a defensive threat position by backing up on its hind legs. By the time it is one month old, the mouse begins to exhibit the attack response. Nonetheless, copious evidence suggests that animals learn and practice aggressive behavior; one need look no further than the sight of a kitten playing with a ball of string. All the elements of attack—stalking, pouncing, biting, and shaking—are part of the game that prepares the kitten for more serious situations later in life. 7) The passage asserts that animal social hierarchies are generally stable because: a) the behavior responses of the group are known by all its members. b) the defensive threat posture quickly stops most conflicts. c) inferior animals usually defer to their physical superior. d) the need for mutual protection from other species inhibits conspecific aggression. 8) According to the author, what is the most significant physiological change undergone by a cat assuming the defensive threat position? a) An increase in cardiovascular activity b) A sudden narrowing of the eyes c) A contraction of the abdominal muscles d) The author does not say which change is most significant 9) Based on the information in the passage about agonistic behavior, it is reasonable to conclude that: I. the purpose of agonistic behavior is to help ensure the survival of the species. II. agonistic behavior is both innate and learned. III. conspecific aggression is more frequent than i aggression. a) I only b) II only c) I and II only d) I,II and III only 10) Which of the following would be most in accord with the information presented in the passage? a) The aggressive behavior of sharks is closely inked to their need to remain in constant motion. b) fine inability of newborn mice to exhibit the attack response proves that aggressive behavior must be learned. c) Most animal species that do riot exhibit aggressive behavior are prevented from doing so by environmental factors. d) Members of a certain species of hawk use the same method to prey on both squirrels and gophers. 11) The author suggests that the question of whether agonistic behavior is genetically programmed or learned: a) still generates considerable controversy among animal behaviorists. b) was first investigated through experiments on mice. c) is outdated since most scientists now believe the genetic element to be most important. d) has been the subject of extensive clinical study. 12) Which of the following topics related to agonistic behavior is NOT explicitly addressed in the passage? a) The physiological changes that accompany attack behavior in cats b) The evolutionary purpose of aggression c) Conspecific aggression that occurs in dominance hierarchies d) The relationship between play and aggression 13) The author of this passage is primarily concerned with: a) analyzing the differences between attack behavior and defensive threat behavior. b) introducing a subject currently debated among animal behaviorists. c) providing a general overview of aggressive behavior in animals. d) illustrating various manifestations of agonistic behavior among mammals.

1055


which is an algorithm for sorting in a growing Lexicographic order

646






 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

1024


how to construct a simulator keeping the logical boolean gates in c

836


write a program to print data of 5 five students with structures?

882


Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1

2039


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

670


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

757


.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; }

170


I need previous papers of CSC.......plz help out by posting them.......

971


difference between object file and executable file

4259


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2523