Aptitude [Sasken Placement]: Sample Questions 31 - 32 of 35

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 31

Aptitude
Edit

Write in Short

Short Answer▾

What are static variables and functions?

Explanation

  • Static is a keyword in C ++ used to give special characteristics to an element. Static elements are allocated storage only once in a program lifetime in static storage area. And they have a scope till the program lifetime.
  • Static Variable: External/global variables have file scope and static storage duration. static used in a block means that the variable lives beyond the duration of the block, and is initialized only once.
  • Static Functions: By default any function that is defined in a C file is extern. This means that the function can be used in any other source file of the same code/project (which gets compiled as separate translational unit) .

Question 32

Aptitude
Edit

Write in Short

Short Answer▾

When asked what the time is, a person answered that the amount of time left is 1/5

of the time already completed. What is the time?

Explanation

  • Whole day is of 24 hours.
  • Let, the completed time is x and remaining time is 24 - x.
  • When a person is asked for time, he answered that the amount of time left is 1/5 of the time already completed.
  • Writing the statement into equation form,

  • So, current time is 20 hrs or 8: 00 p. m.

Developed by: