Home - Technical Questions - Programming

Programming Online Exam Quiz

Important questions about Programming. Programming MCQ questions with answers. Programming exam questions and answers for students and interviews.

1. enum colors {BLACK,BLUE,GREEN} main() { printf( "%d..%d..%d", BLACK, BLUE, GREEN ); return(1); }

Options

A : 1..2..3

B : 0..1..2

C : 1..1..1

D : 0..0..0

2. What will be output when you will execute following c code? #include void main() { signed int a = -1; unsigned int b = -1u; if(a == b) printf( "The Lord of the Rings" ); else printf( "American Beauty" ); }

Options

A : The Lord of the Rings

B : American Beauty

C : Compilation error: Cannot compare signed number with unsigned number

D : Warning: Illegal operation

4. In programming, repeating some statements is usually called ?

Options

A : Running

B : Structure

C : Looping

D : Control structure

5. What will be output when you will execute following c code? #include void main() { int const SIZE = 5; int expr; double value[SIZE] = { 2.0, 4.0, 6.0, 8.0, 10.0 }; expr=1|2|3|4; printf ( "%f", value[expr] ); }

Options

A : 2.000000

B : 4.000000

C : 8.000000

D : Compilation error

6. A function cannot be defined inside another function

Options

A : TRUE

B : FALSE

C :

D :

7. What will be output of the following c program ? #include int main() { int max-val=100; int min-val=10; int avg-val; avg-val =( max-val + min-val ) / 2; printf( "%d", avg-val ); return 0; }

Options

A : 55

B : 105

C : 60

D : Compilation error

8. SNOBOL is mainly used for

Options

A : Text Operation

B : String operations

C : List operations

D : Numerical operations

9. What is the output of this C code? #include int main() { int a = 1, b = 1; switch (a) { case a*b: printf("yes "); case a-b: printf("non"); break; } }

Options

A : yes

B : no

C : Compile time error

D : yes no

10. Which of the following statement is true?

Options

A : Cohesion is the OO principle most closely associated with hiding implementation details

B : Cohesion is the OO principle most closely associated with making sure that classes know about other classes only through their APIs

C : Cohesion is the OO principle most closely associated with making sure that a class is designed with a single, well-focused purpose

D : None

1. How many times i value is checked in the below code? #include int main() { int i = 0; do { i++; printf( "In while loopn" ); } while (i < 3); }

Options

A : 2

B : 3

C : 4

D : 1

2. void main() { char good *better, *best; printf( "%d..%d", sizeof(better), sizeof(best) ); }

Options

A : 1..2

B : 4..4

C : 4..2

D : 2..2

3. Output of the Program : main() { int i = 1; while (i <= 5) { printf( "%d", i ); if (i > 2) goto here; i++; } } fun() { here : printf( "PP" ); }

Options

A : 1

B : 2

C : Compilation error

D : Exception occurs

4. Which Of The Following Statements Is Most Accurate For The Declaration X = Circle()?

Options

A : x contains a reference to a Circle object

B : You can assign an int value to x

C : x contains an object of the Circle type

D : x contains an int value

5. What is the output of this C code? #include void main() { int y = 3; int x = 5 % 2 * 3 / 2; printf("Value of x is %d", x); }

Options

A : Value of x is 1

B : Value of x is 2

C : Value of x is 3

D : Compile time error

6. What is the output of this C code? #include void main() { int x = 1, z = 3; int y = x << 3; printf( "%dn", y ); }

Options

A : -2147483648

B : -1

C : Run time error

D : 8

7. What would be the output of the following program ? main() { const int x = 5; int *ptrx; ptrx = &x; *ptr = 10; printf ("%d", x); }

Options

A : 5

B : 10

C : Error

D : Garbage value

1. What will be output when you will execute following c code? #include void main() { switch(2) { case 1L:printf("No"); case 2L:printf("%s","I"); goto Love; case 3L:printf("Please"); case 4L:Love:printf("Hi"); } }

Options

A : I

B : IPleaseHi

C : IHi

D : Compilation error

5. Macro flowchart is also called as

Options

A : Less Detail flowchart

B : More detail flowchart

C : Simple detailed flowchart

D : None of the above

6. public abstract interface Frobnicate { public void twiddle(String s); } Which is a correct class?

Options

A : public abstract class Frob implements Frobnicate { public abstract void twiddle(String s) { } }

B : public abstract class Frob implements Frobnicate { }

C : public class Frob extends Frobnicate { public void twiddle(Integer i) { } }

D : public class Frob implements Frobnicate { public void twiddle(Integer i) { } }

8. What value does read() return when it has reached the end of a file?

Options

A : 1

B : -1

C : 0

D : None

Technical Questions more Online Exam Quiz

Copyright © 2021
Exam-GK-MCQ-Questions.Com | Contact Us | Privacy Policy | Terms of Use | Sitemap | 0.019599914550781