Programming and Data Structures (GATE Computer Science): Questions 128 - 133 of 151

Get 1 year subscription: Access detailed explanations (illustrated with images and videos) to 913 questions. Access all new questions we will add tracking exam-pattern and syllabus changes. View Sample Explanation or View Features.

Rs. 450.00 or

Question number: 128

» Programming and Data Structures » Programming in C

MCQ▾

Question

What will be output if you will compile and execute the following c code?

  1. void main()
  2. {
  3.     int a=-12;
  4.     a=a>>3;
  5.     printf("%d",a);
  6. }

Choices

Choice (4) Response
a.

96

b.

2

c.

3

d.

4

Question number: 129

» Programming and Data Structures » Programming in C

MCQ▾

Question

What will be output if you will compile and execute the following c code?

  1. struct marks
  2. {
  3.     int p:3;
  4.     int c:3;
  5.     int m:2;
  6. }
  7. ;
  8. void main()
  9. {
  10.     struct marks s=
  11.     {
  12.         2,-6,5
  13.     }
  14.     ;
  15.     printf("%d %d %d",s.p,s.c,s.m);
  16. }

Choices

Choice (4) Response
a.

2 2 1

b.

2 6 5

c.

error

d.

2 6 1

Question number: 130

» Programming and Data Structures » Programming in C

MCQ▾

Question

Which of the following is a general-purpose programming language, designed by Sun Microsystems, and well suited for use on the Web?

Choices

Choice (4) Response
a.

Javascript

b.

CSS

c.

Vb script

d. Question does not provide sufficient data or is vague

Question number: 131

» Programming and Data Structures » Programming in C

MCQ▾

Question

What will be output if you will compile and execute the following c code?

  1. void main()
  2. {
  3.     int huge*p=(int huge*)0XC0563331;
  4.     int huge*q=(int huge*)0xC2551341;
  5.     *p=200;
  6.     printf("%d",*q);
  7. }

Choices

Choice (4) Response
a.

0

b.

null

c.

garbage value

d.

200

Question number: 132

» Programming and Data Structures » Programming in C

MCQ▾

Question

Negative numbers cannot be represented in

Choices

Choice (4) Response
a.

‘2’ s complement form

b.

‘1’ s complement form

c.

signed magnitude form

d. None of the above

Question number: 133

» Programming and Data Structures » Programming in C

MCQ▾

Question

Write a c program which displays mouse pointer and position of pointer. (In x coordinate, y coordinate)?

  1. #include ”dos.h
  2. #include” stdio.h
  3. void main() {
  4.     union REGS io;
  5.     int xyk;
  6.     //show mouse pointer
  7.     i.x.ax = 1;
  8.     int86(0x33, & i, & o);
  9.     while (!kbhit()) {
  10.         i.x.ax = 3;
  11.         x = o.x.cx;
  12.         y = o.x.dx;
  13.         clrscr();
  14.         printf(“( % d, % d)”, xy);
  15.         delay(250);
  16.         int86(0x33, & i, & o);
  17.     }
  18.     getch();
  19. }

Choices

Choice (4) Response
a.

error

b.

wrong

c.

right

d. None of the above

Sign In