Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Which one of the following is most appropriate description of “algorithm"1. Source code2. Executable image3. Object file4. Statements laying down a step-by-step execution of the programme

Answer» Correct Answer - Option 4 : Statements laying down a step-by-step execution of the programme

Explanation:

Algorithms: An algorithm is a list of instructions or formulas for solving a problem, based on conducting a sequence of specified actions. 

The set of instructions can also be expressed independently of any programming language to solve a specific problem which is called an algorithm. 

  • The algorithm consists of a set of explicit and unambiguous finite steps that, when carried out for a given set of initial conditions, produce the corresponding output and terminate in a finite time. 
  • For Example, To understand the concept of an algorithm, let us consider a simple example of real-life problem-solving. To look for the meaning of a word from a dictionary, one wouldn’t go to the first word in the dictionary and search until the required word is found. An algorithm can be applied by taking advantage of the alphabetical order of words in a dictionary. 
  • Purpose: To obtain a solution to a problem through the computer, usually we have to provide the computer program with input or data. The program then takes this input and manipulates it according to its instructions and eventually produces an output that represents the computer solution to the problem.

Hence, we conclude that an algorithm is a set by step execution of the programme intended to solve a specific problem.

Hence option (4) is the correct answer.

2.

Write an algorithm to convert temperature from Celsius to Fahrenheit

Answer»

The algorithm for the conversion of temperature from Fahrenheit to Celsius is as follows:

  1. Read the temperature given in degree Fahrenheit.
  2. Convert the temperature in Fahrenheit into Celsius using the formula : C=5/9*(F-32)
  3. Print the Fahrenheit and Celsius value of temperature.
  4. End

The code for the same is -

# include < stdio . h >

# include < conio . h >

void main (  )

{

         float    a , b ;

         clr scr( ) ;

         printf(" Fahrenheit: ");

         scanf("%f", & b );

         a = ( b - 32 ) * ( 5 / 9 ) ;

         printf(" \ n \ t % . 2b Fahrenheit = % . 2b Centigrade " , b , a ) ;