C Interview Questions
Questions Answers Views Company eMail

write a program to insert an element at the specified position in the given array in c language

IBM, Appin,

20775

What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);

4757

how to generate the length of a string without using len funtion?

4109

write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]

9078

Write a program to generate prime factors of a given integer?

3705

write a program to generate 1st n fibonacci prime number

3436

write a program to generate 1st n fibonacci prime number

27007

Write a program to generate prime factors of a given integer?

26303

write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]

27110

1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if

TCS,

3235

if ENTERED FIVE DIGITS DESIGN A PROGRAM THAT WILL FIND CORRESPONDING VALUE FROM ASCII TABLE

2190

YBJBU6

1731

Program to display given 3 integers in ascending order

3603

Program to find the absolute value of given integer using Conditional Operators

18072

Program to find the value of e raised to power x using while loop

27415

Un-Answered Questions { C }

Difference between Shallow copy and Deep copy?

832

how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?

723

Sir i need notes for structure,functions,pointers in c language can you help me please

1235

write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34

844

in iso what are the common technological language?

921

what is the significance of static storage class specifier?

874

what is the difference between class and unio?

1095

please send me the code for multiplying sparse matrix using c

1002

can any one tel me wt is the question pattern for NIC exam

838

what is the height of tree if leaf node is at level 3. please explain

841

write a program to find the given number is prime or not

2329

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.

1046

writ a program to compare using strcmp VIVA and viva with its output.

719

develop a breakfast order booking system using Functions, Structures and Arrays. The system is to support the operations shown to the user in the following system’s menu: Welcome to Asim's Restaurant Select an operation? 1 Make a breakfast order 2 Modify existing order 3 Cancel existing order 4 Print Bill 5 Exit Type in your selection (1, 2, 3, 4 or 5): The program will include an array of structures. The structure type is called MenuItem, and the array of structures should be declared as menu[50] to store upto 50 breakfast menu items. The MenuItem structure must have the following 4 data fields (i.e. members): Code, description, unitprice, and quantity. Your program must define at least the following functions:  Function LoadData(…) that loads the data of breakfast menu items from an input file menu.txt into the array menu.  Five separate functions to handle the program main menu five tasks shown above. In general, function main() should load the data into the array menu and display the main menu of the above mentioned tasks. Based on the option selected, the corresponding function should be called. Users must make an order before requesting modify, cancel or print order bill (See the given sample run). Here is a more detailed explanation on the above tasks and functions. LoadData(…) Opens the input file menu.txt (you will create it) containing breakfast menu items data (See below) and assign these values to the corresponding array menu structure fields. Assign zero to the quantity field of the loaded menu items. Welcome to Asim's Restaurant Select an operation? 1 Make a breakfast order 2 Modify existing order 3 Cancel existing order 4 Print Bill 5 Exit Type in your selection (1, 2, 3, 4 or 5): MakeOrder(…) This function is called when the user selects option 1 from the main menu. It first displays the breakfast menu items to the user (stored in the array menu) along with all the necessary information (item code, description and unit price). It then requests the user to select an item using the item code (see the sample run). When the user enters an item code number the program should verify the code number and increment the quantity of the selected item in the array menu. Your program should reject invalid item codes and request the user to re-enter the item code or stop the entry. PrintBill(…) This function is called when the user selects option 4 from the main menu. The function displays the breakfast menu items in the breakfast order by printing the values of all MenuItem members of the array menu that have quantity value above zero. Print a nicely formatted bill (See the sample run). CancelOrder(…) This function is called when the user selects option 3 from the main menu. It will cancel the breakfast order by setting the quantity value of all the array menu structures to zero. ModifyOrder(….) This function is called when the user selects option 2 from the main menu. The task of this function is to allow the user to edit an existing breakfast order with two operations: Adding more breakfast items and/or altering the breakfast item that were ordered before (examine the sample program run). Handling Errors and Invalid Input Your program should reply safely to any erroneous situation or input with appropriate message to the user and flow nicely and correctly to the next operation (Examine the sample program run). Additional functions Use of functions is highly recommended for any additional special tasks needed by your solution. Global variables are not allowed except for max array menu size 50. You must pass the needed parameters through functions parameter lists.

1134

Is Exception handling possible in c language?

821