Languages [3i Infotech Placement]: Sample Questions 502 - 504 of 546

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 502

Question

MCQ▾

Line of Sight is

Choices

Choice (4)

a.

Parabolic

b.

Tx & Rx should be visible to each other

c.

Straight Line

d.

Question does not provide sufficient data or is vague

Answer

b.

Explanation

  • Line of site means Tx (transmitter) & Rx (Receiver) should be visible to each other.
  • Straight Line means that the wave is transmitted from Tx to Rx in a straight line.

Question 503

Edit

Write in Short

Short Answer▾

How do you print a string on the printer?

Explanation

Following code gives an example:

const char ⚹ hello = “! ! ! Hello Printer! ! ! ⧵f” ;

if (WritePrinter (hPrinter, (void ⚹) hello, strlen (hello) , &dwBytesWritten) ) {

puts ( “printer opened” ) ;

}

Question 504

Edit

Describe in Detail

Essay▾

Write a program to generate the Fibonacci series.

Explanation

  1. #include<stdio.h>
  2. intmain()
  3. {
  4.     intn, first =0, second =1, next, c;
  5.     printf("Enter the number of terms");
  6.     scanf("%d",&n);
  7.     printf("First %dtermsofFibonacciseriesare);
  8.     for ( c =0 ; c <n ; c++ )
  9.     {
  10.         if ( c <= 1 )
  11.         next =c;
  12.         else
  13.         {
  14.             next =first +second;
  15.             first =second;
  16.             second =next;
  17.         }
  18.         printf("%d",next);
  19.     }
  20.     return0;
  21. }

OUTPUT

Enter the number of terms: 5

First 5 terms of Fibonacci series are:

0

1

1

2

3

Developed by: