1. Which of the following
is not a valid variable name declaration?
Ans- 1. D
Ans-2. A
Ans-3. D
4. What will be the output
of the following C code?
1. #include <stdio.h>
2. int main()
3. {
4. printf("Hello World!
%d \n", x);
5. return 0;
6. }
a) Hello World! x;
b) Hello World!
followed by a junk value
c) Compile time
error
d) d) Hello World!
Ans-4.
C
Ans-5. B
6. What will be the output
of the following C code?
1. #include <stdio.h>
2. int main()
3. {
4. int i = 5;
5. i = i / 3;
6. printf("%d\n", i);
7. return 0;
8. }
Ans-6. B
Ans-7. A
Ans-8. C
9.What will be the output
of the following C code?
1. #include <stdio.h>
2. void main()
3. {
4. int x = 1, y = 0, z = 5;
5. int a = x && y || z++;
6. printf("%d", z);
7. }
Ans-9. A
Ans-10. B
Ans-11. D
12. What will be the
output of the following C code?
1. #include <stdio.h>
2. int main()
3. {
4. int a = 1, b = 1, c;
5. c = a++ + b;
6. printf("%d, %d", a, b);
7. }
Ans-12. B
13. What will be the
output of the following C code?
1. #include <stdio.h>
2. int main()
3. {
4. int a = 10, b = 10;
5. if (a = 5)
6. b--;
7. printf("%d, %d", a, b--);
8. }
a) a = 10, b = 9
Ans-13. C
14. What will be the
output of the following C code?
1. #include <stdio.h>
2. void main()
3. {
4. int x = 4, y, z;
5. y = --x;
6. z = x--;
7. printf("%d%d%d", x, y, z);
8. }
Ans-14. B
15. What is the type of the following
assignment expression if x is of type float and y is of type int?
y = x + y;
Ans-15. A
16. Which expression has
to be present in the following?
Ans-16. D
17. Who is called the
father of c programming language?
Ans-17. D
18.Nesting of if-else
statement is allowed in c programming?
a) Yes
b) NO
Ans-18. A
19. Can we test range 5 to
7 or 8 to 10 using a switch statement in C Programming ?
switch(choice)
{ case 5 : case 6 : case 7 : printf("Case 5-7"); break; case 8 : case 9 : case 10: printf("Case 8-10"); break; }a) Yes
b) No
Ans-19. A
20) How many keywords are
available in c language?
a)67
b)36
c)32
d)49
Ans-20. C
21) What is/are the number of operand/operands
needed to unary operator logical not(!)?
a)4
b)3
c)2
d)1
Ans-21 d
22) While assigning a value
to a variable, which operators are used to perform artithmetic operations?
a)Logical operator
b)Assignment operator
c)Increment Operator
d)Conditional Operator
Ans-22 b
23)An operator used to check
a condition and select a value depending on the value of the condition is
called
a)Logical Operator
b)Decrement Operator
c)Conditional or Trnary
Operator
d)Bitwise Operator
Ans-23 c
24)The size of a character
variable in C is
a)8 Bytes
b)4 Bytes
c)2 Bytes
d)1 Bytes
Ans-24 d
Ans-25 b
Ans-26 c
27. Which Header file we
can used for in string functions?
Ans-27 a
|
28. |
Is there any difference
between the two statements? a)Yes b)No Ans-28 a |
|
a) conio.h
b) stdlib.h
c) stdio.h
d) dos.h
Ans-29 c
30)A pointer to a block of memory is
effectively same as an array
a)Yes
b)No
Ans-30 a
31)Using
_______ statement is how you test for a specific condition.
a. Select
b. If
c. Switch
d. For
Ans-31 b
32)It
is possible to pass a structure variable to a function either by value or by
address.
a)Yes
b)No
Ans-32 a
33)C
programming : If you want to store dissimilar data together, then which type
you will use?
a. array
b. structure
c. stack
d. None of the above.
Ans-33 b
34) Which of
the following is a keyword used for a storage class?
a)printf
b)auto
c)switch
d)struct
Ans-34 b
35) Qhich function is used to read character as you type ?
a)getchar()
b)getch()
c)getche()
d)Both B & C
Ans-35 b
36)What the
follwing function call mean? Strcpy(s1 , s2 );
a) copies s1 string into s2
b) copies s2 string into s1
c)copies both s1 and s2
d)None
of these
Ans-36 a
37 )Which is valid string function ?
a) strpbrk
b) strlen
c) strxfrm
d) strcut
Ans-37 b
38) int **x;
a) x is a pointer to pointer
b) x is not pointer
c) x is long
d) None of these
Ans-38 a
39)A
declaration float a,b; accupies ______of memory ?
a)
1 bytes
b)
4bytes
c)
8byte
d)
16 bytes
Ans-39 c
40)C was
developed in the year ___
a)1970
b)1972
c)1976
d)1980
Ans-40 b
41)C
is a ___ language
a)
High Level
b)
Low Level
c)
Middle Level
d)
Machine Level
Ans-41 c
42)Which of
the following are tokens in C?
a) Keywords
b) Variables
c) Constants
d) All of the
above
Ans-42 d
43)How many times i value is
checked in the following C code?
1. #include <stdio.h>
2. int main()
3. {
4. int i = 0;
5. do {
6. i++;
7. printf("in while loop\n");
8. } while (i < 3);
9. }
Ans-43 b
44) How many times i value
is checked in the following C code?
1. #include <stdio.h>
2. int main()
3. {
4. int i = 0;
5. while (i < 3)
6. i++;
7. printf("In while loop\n");
8. }
Ans-44 c
45)Which
operator in C is called a ternary operator
a) if..then
b)++
c)()
d)?
Ans-45 d
46)Which of
the following header file is required for strcpy() function?
a) string.h
b) strings.h
c) files.h
z) strcpy()
Ans-46 a
47). What will be the output of the
following C code?
1. #include <stdio.h>
2. void main()
3. {
4. double k = 0;
5. for (k = 0.0; k < 3.0; k++)
6. printf("Hello");
7. }
Ans-47 b
48). What will be the output of the following C code?
1. #include <stdio.h>
2. struct student
3. {
4. int no;
5. char name[20];
6. }
7. void main()
8. {
9. struct student s;
10. s.no = 8;
11. printf("hello");
12. }
Ans-48 a
49)Maximum
number of elements in the array declaration int a[5][8] is
a)28
b)32
c)35
d)40
Ans-49) d
50) What will be the output of the
following program ?
void main ( )
{
int
x=10,y=20; printf (“\n %d”,x,y);
}
a)10
b)20
c)10 20
d)None of
these
Ans-50) c

No comments:
Post a Comment