How To Exam?

a knowledge trading engine...


The Institution of Engineers,India 2006 Diploma Electronics and Communication PROBLEM SOLVING THROUGH ‘C’ - - Question Paper

Sunday, 16 June 2013 12:05Web

Code: DC-05 Subject: issue SOLVING THROUGH ‘C’
Time: three Hours June 2006 Max. Marks: 100

NOTE: There are nine ques. in all.
• ques. one is compulsory and carries 20 marks. ans to Q. 1. must be written in the space given for it in the ans book supplied and nowhere else.
• Out of the remaining 8 ques. ans any 5 ques.. every ques. carries 16 marks.
• Any needed data not explicitly given, may be suitably presumed and said.


Q.1 select the accurate or best option in the following: (2x10)

a. The << operator is used for

(A) Right shifting (B) Left shifting
(C) Bitwise shifting (D) Bitwise complement

b. The C language includes the header file standard input & output in

(A) stdlib.h library (B) stdio.h library
(C) conio.h library (D) #include library

c. The value that follows the keyword CASE may only be

(A) constants (B) variable
(C) number (D) semicolon

d. The statement which is used to terminate the control from the loop is

(A) break (B) continue on
(C) goto (D) exit

e. The machine registers are sometimes called

(A) local variables (B) global variables
(C) accumulators (D) static variables

f. Set of values of the identical type, which have a single name followed by an index is called

(A) function (B) structure
(C) array (D) union

g. An array of pointers is identical as

(A) pointer to array (B) pointers to pointers
(C) pointer to function (D) pointer to structure
h. What is the output of the subsequent program segment?
main()
{
long i = 65536;
printf(“%d\n”, i);
}

(A) 0 (B) 65536
(C) -1 (D) 65

i. What is the output of the subsequent program segment?
main()
{
int i = 1;
do
{ printf(“%d..”, i);
} while(i--);
}

(A) 0..1.. (B) 1..0..
(C) 0 (D) -1

j. What is the output of the subsequent program segment?
main()
{
int i = ++2;
printf(“%d\n”, i);
}

(A) three (B) two
(C) 0 (D) -1


ans any 5 ques. out of 8 ques..
every ques. carries 16 marks.

Q.2 a. discuss divide & conquer strategy to solve any issue. (4)

b. discuss the common programming errors. (6)

c. Write down steps, which are included in implementation of algorithms. (6)

Q.3 a. Design an algorithm for a provided number n, calculate n factorial (written as n!) where n 0. (8)

b. Design an algorithm for the generation of the fibonacci sequence. (8)

Q.4 a. What is meant by identifiers? How do identifiers differ from keywords? (6)

b. elaborate the bitwise logical operators? (4)
c. discuss the subsequent statements:
(i) getchar() (ii) putchar() (6)

Q.5 a. Summarise the syntactic rules of the subsequent loop statements?
(i) for loop (ii) while loop
(iii) do-while loop (6)

b. What is meant by the conditional expression? (4)

c. Write a program to obtain the sum & avg. of the provided numbers using the do----while loop. (6)

Q.6 a. What is a function? List out the advantages & disadvantages of using functions in C? (4)

b. When passing parameters to functions, discuss the difference ranging from pass-by-value and pass-by-reference. (4)

c. Write a program to obtain the sum of provided non-negative integers using a function declaration.
Sum = 1+2+3+4+-------n (8)

Q.7 a. What is an array & how is an array variable various from an ordinary variable? (4)

b. describe an union which contains 2 members-colour which is an array of 12 characters and size which is int. describe 2 union variables and assign values to them. (4)

c. Write a program to learn a set of lines from the keyboard & remove the white spaces such as tab, space, carriage return, new line, line feed & vertical tab from the text & display onto the screen. (8)

Q.8 a. Distinguish ranging from the subsequent functions when operating on files:

(i) rewind and ftell
(ii) printf and fprintf
(iii) feof and ferror
(iv) getc and putc (8)

b. Write a program to copy the contents of 1 string to a different string using a pointer method. (8)

Q.9 a. What is meant by conditional compilation? (4)

b. elaborate the various functions involved in ctype.h? (6)

c. Write a program to learn a set of values from the keyboard using a pointer structure operator & to display the contents of the structure onto the screen. (6)




Code: D-22 Subject: INDUSTRIAL ELECTRONICS

Code: DC-05           Subject: PROBLEM SOLVING THROUGH C

Time: 3 Hours                                            June 2006                                                         Max. Marks: 100

 

NOTE: There are 9 Questions in all.

      Question 1 is compulsory and carries 20 marks. Answer to Q. 1. must be written in the space provided for it in the answer book supplied and nowhere else.

      Out of the remaining EIGHT Questions answer any FIVE Questions. Each question carries 16 marks.

      Any required data not explicitly given, may be suitably assumed and stated.

 

 

Q.1       Choose the correct or best alternative in the following:                                         (2x10)

       

a.       The << operator is used for  

 

                   (A)  Right shifting                                 (B)  Left shifting

(C)    Bitwise shifting                             (D)  Bitwise complement

       

b.      The C language includes the header file standard input & output in

 

(A)    stdlib.h library                               (B)  stdio.h library

(C)  conio.h library                              (D)  #include library

            

             c.   The value that follows the keyword CASE may only be

                  

(A)    constants                                      (B)  variable

(C)  number                                         (D)  semicolon

 

             d.   The statement which is used to terminate the control from the loop is

 

(A)    break                                          (B) continue

(C)  goto                                            (D) exit     

 

             e.   The machine registers are sometimes called

                  

(A)     local variables                              (B)  global variables

(C)  accumulators                                (D)  static variables

 

             f.    Set of values of the same type, which have a single name followed by an index is called

 

(A)     function                                        (B)  structure

(C)  array                                            (D)  union

 

             g.   An array of pointers is same as

 

(A)     pointer to array                            (B)  pointers to pointers

(C)  pointer to function                         (D)  pointer to structure

             h.   What is the output of the following program segment?

                   main()

                   {

                   long i = 65536;

                   printf(%d\n, i);

                   }

                 

(A)     0                                                 (B) 65536

(C)  -1                                                (D) 65

 

             i.    What is the output of the following program segment?

                   main()

                   {

                   int i = 1;

                   do

                   { printf(%d.., i);

                   } while(i--);

                   }

                  

(A)   0..1..                                            (B) 1..0..

(C) 0                                                   (D) -1

 

             j.    What is the output of the following program segment?

                   main()

                   {

                   int i = ++2;

                   printf(%d\n, i);

                   }

 

(A)    3                                                  (B)  2        

(C)  0                                                  (D)  -1

 

 

Answer any FIVE Questions out of EIGHT Questions.

Each question carries 16 marks.

 

  Q.2     a.   Explain divide & conquer strategy to solve any problem.                                     (4)

       

             b.   Explain the common programming errors.                                                           (6)

 

             c.   Write down steps, which are included in implementation of algorithms.                (6)          

 

  Q.3     a.   Design an algorithm for a given number n, compute n factorial (written as n!) where n  0.              (8)

 

             b.   Design an algorithm for the generation of the fibonacci sequence.                         (8)

 

  Q.4     a.   What is meant by identifiers?  How do identifiers differ from keywords?              (6)

                  

             b.   What are the bitwise logical operators?                                                               (4)

              c.   Explain the following statements:          

                   (i)  getchar()                                        (ii)  putchar()                                           (6)          

 

  Q.5     a.   Summarise the syntactic rules of the following loop statements?

                   (i)   for loop                                         (ii)  while loop

                   (iii) do-while loop                                                                                               (6)

       

             b.   What is meant by the conditional expression?                                                      (4)

 

             c.  Write a program to find the sum & average of the given numbers using the do----while loop.                                                                       (6)

 

  Q.6     a.   What is a function? List out the advantages & disadvantages of using functions in C?                       (4)

 

             b.   When passing parameters to functions, explain the difference between pass-by-value and pass-by-reference.                                                           (4)

 

             c.   Write a program to find the sum of given non-negative integers using a function declaration.

                   Sum = 1+2+3+4+-------n                                                                                 (8)

 

  Q.7     a.   What is an array & how is an array variable different from an ordinary variable?                  (4)   

 

             b.   Define an union which contains two members-colour which is an array of 12 characters and size which is int. Define two union variables and assign values to them.                                                    (4)

 

             c.   Write a program to read a set of lines from the keyboard & remove the white spaces such as tab, space, carriage return, new line, line feed & vertical tab from the text & display onto the screen.    (8)

            

  Q.8     a.   Distinguish between the following functions when operating on files:

 

(i)                  rewind and ftell

(ii)                printf and fprintf

(iii)               feof and ferror

(iv)              getc and putc                                                                             (8)

 

             b.   Write a program to copy the contents of one string to another string using a pointer method.                                                                       (8)

 

  Q.9     a.   What is meant by conditional compilation?                                                          (4)

 

             b.   What are the different functions involved in ctype.h?                                            (6)                      

                  

             c.   Write a program to read a set of values from the keyboard using a pointer structure operator & to display the contents of the structure onto the screen.                                                       (6)

 

 


( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER The Institution of Engineers,India 2006 Diploma Electronics and Communication PROBLEM SOLVING THROUGH ‘C’ - - Question Paper