30. char txt[20] = "Hello World \ 0";
How many bytes are allocated for above definition?
A) 11
31. int i=4; int x=6; double z;
B) 12 C) 21 D) 20
z=x/I;
printf("z = %.2f\n",z);
What will above code print?
(A) Z=1.00
(C) Z=O.OO
(B) Z=1.50 (D) Z=2.00
32. Which of following variable name is not valid?
(A) go_cart (B) 4season (C) run4
33. long factorial(long x)
{
????
return x*factoriai(x-1);
}
(D) _what
What should replace ????to make function return correct result?
(A) If(x==0) return 0; (C) If(x<=l) return 1 ;
(B) If(x>=2) return 2 ; (D) If(x==0) return 1;
34.
|
How variable is accessed from other file?
(A) The global variable is referenced via the extern specifier
|
|
|
(B) The global variable is referenced via the pointer specifier.
|
|
(C) The global variable is referenced via the global specifier.
|
|
(D) The global variable is referenced via auto specifier.
|
35.
|
What number is equivalent to 4e3?
|
36.
|
(A) 40 (B) 0.004 (C) 400 (D) 4000
How does a variable definition differ from declaration?
|
|
(A) Variables may be defined many times but declared only once
|
|
(B) Definition allocates storage for a variable, but declaration only informs the
|
compiler the type.
|
|
(C) Variable definition must be preceded by variable declaration
|
|
|
(D) There is no difference in C between variable declaration and definition.
|
|
37. int x[] ={1, 2, 3, 4, 5}
int u;
int *ptr = x;
????????
for (u=0,u<5;u++)
{
printf(“%d-” x*u+)
}
printf(“\n”)
Which one of following will replace the ????in the code above to cause string 1-2-3-10-5- to be printed?
(A) *ptr + 3 = 10
(C) *(ptr+3) = 10
38. #include <stdio.h>
Void func()
int x=0;
static int y=O;
(B) *ptr[3] =10
(D) (*ptr)[3] = 10
x++,y++;
printf("%d%d \ n" ,x,y);
}
void main()
{
Func(); Func(); return 0;
}
What will be output of the above code?
(A) 1-1
2-1
(C) 1-1
1-2
(B) 1-1
1-2
(D) 1-0
1-0;
39. Except 1 all choices are O,K. c = getchar();
What is the proper declaration for the variable in the code above?
(A) Unsigned int c; (B) Unsigned char c; (C) int c; (D) char c;
40. When did the first ANSI come out?
(A) 1949 (B) 1975 (C) 1958 (D) 1966
41. Which of following is not standard issuing body?
(A) X3 (B) ISO (C) BSI (D) ANSI
42. List in chronological order, when these languages officially recognized as a standard.
1. ANSIC
2. ANSI COMMON LISP
3. ANSI COBOL
4. ANSI ADA
(A) 1,2,3,4 (D) 1,3,2,4 (C) 4,3,1,2 (D) 1,3,42
43. What are standards for?
1.
2.
3.
4.
2 and 4
To provide uniformity for everyone.
To allow monopoly of the product in the industry
To define a level of quality others have to meet
To restrict unauthorized changes in a design and its development (A)
(B) 1 and 3
(C) 1,2 and 4 only
(D) None of above
44. What implementation of C++ makes C++ programming language powerful?
(A) Easy implementation
(B) Reusing of code
(C) Easy memory management
(D) All the above
45. What are the main differencesbetween 3rd and 4th generationlanguages?
I. Both follow procedural code
II. Third generation language aremostly compiled languages.
III. Fourth generation languages are in-line with minimum work and skill concept
IVThird generation languages are user friendly and have intelligent default option.
(A) ii and iii only
(B) i and iv only
(C) i and iii only
(D) None
46. Which of following features would make next generation PL popular?
I. They are highly portable and are offered over wide range of systems
II. They are suitable for development of programs of arbitrary size and complexity.
III. They are reasonably stable during changes in hardware and system software.
IV. They have both procedural and nonprocedural approach.
(A) ii and iii only
(C) iii and iv only
(B) I, iii and iv only
(D) all
47. Which of following language has potential to become the next programming language?
I. Java II. Html
III. COBOL97 IV.ADA95
(A) I and N only (B) I AND II only
(C) I and III only (D) NONE
48. #define max 10 +2
void main()
{
int i;
i = max*max;
clrscr();
printf("%d" ,i);
getch();
}
What will be the output?
(A) 32 (B) 60 (C) 12
Share with your friends: |