3i Infotech Placement: Sample Questions 986 - 988 of 1245

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

Question 986

Edit

Describe in Detail

Essay▾

How do you declare the following:

Explanation

  • An array of three pointers to chars.
    • char ⚹ p [3] ;
    • An array of three char pointers.
    • char ⚹ p [3] ;
    • A pointer to array of three chars.
    • char (⚹ ptr) [3] ;
    • A pointer to function which receives an int pointer and returns a float pointer.
    • float ⚹ (⚹ ptr) (int ⚹) ;
    • A pointer to a function which receives nothing and returns nothing.
  • void (⚹ ptr) () ;

Question 987

Edit

Describe in Detail

Essay▾

Is the process before and after the swap are the same?

Explanation

Swapping of Two Processes
  • Process before swapping is residing in the primary memory in original form.
  • All regions however are not occupied by the process with few empty slots in the regions. While swapping kernel ignores empty slots.
  • After swapping the process resides in the swap device.
  • The regions swapped out will not have empty slots that were present before assigning.
  • When the process is brought again into the main memory kernel referring takes care of the empty slots in the regions.

Question 988

Edit

Describe in Detail

Essay▾
  1. #include<studio.h>
  2. main ()
  3. {
  4.     structxx
  5.     {
  6.         intx =3;
  7.         charname[] =“hello
  8.     };
  9.     structxx ⚹s;
  10.     printf ( “%d” s ⇾ x);
  11.     printf ( “%s” s ⇾ name);
  12. }

Explanation

  • In C language all variables declare in first and then apply and function.
  • But here should not initialize variables in declaration.
Table Shows the Program
  1. structxx
  2. {
  3.     intx =3;
  4.     charname[] =“hello
  5. };
Here struct xx is a declaration

Define integer variable x = 3

And char array name [] = “hello”

struct xx ⚹ s;Struct xx define a pointer s
printf ( “% d” s ⇾ x) ;Here print the value of x but x not initialize variable in declaration
  • So the Answer is Compiler Error.

Developed by: