Aptitude [ST Microelectronics Placement]: Sample Questions 18 - 19 of 40

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 18

Aptitude
Edit

Write in Short

Short Answer▾

What will be the output of the following program?

  1. charstr=“helloneha”;
  2. printf(“n%s”,str);

Explanation

  • Compilation error
  • Here, str is defined as a character variable. Any character variable can store only one character at a time. So there will be compilation error in the output.
  • If we want to store more than one character in a character variable then either we can declare an array with indeterminate size and assign the string literal to the array as it is declared or with use of pointers. Since the string literal already be in memory when we run the application, we can just point to it.

Question 19

Aptitude
Edit

Statement

True-False▾

All chickens lay eggs

Answer

FALSE

Explanation

  • No all chickens don՚t lay eggs. Roosters are among them. Only hens will lay eggs. Hens will lay eggs just as well in the absence of roosters. If roosters are present, however, the eggs may be fertilized.
  • Some chickens lay less eggs than others. For instance, decorative breeds and meat breeds will not lay as many eggs as chickens bred for their eggs. Also, older hens will gradually lay less and less eggs as they age.

Developed by: