5CSE1_T&P questions

5CSE1_T&P questions

University

15 Qs

quiz-placeholder

Similar activities

Exploring the Basics of C Programming

Exploring the Basics of C Programming

11th Grade - University

20 Qs

Bitwise Operators

Bitwise Operators

University

10 Qs

Arrays

Arrays

University

15 Qs

Quiz on Object Oriented Programming and Java

Quiz on Object Oriented Programming and Java

University

15 Qs

Memory Management

Memory Management

University

10 Qs

SJIT ECE APTITUDE PRACTICE TEST-1@10-11-2023

SJIT ECE APTITUDE PRACTICE TEST-1@10-11-2023

University

20 Qs

Junk Genius

Junk Genius

University

11 Qs

DEPTH DIVE

DEPTH DIVE

University

15 Qs

5CSE1_T&P questions

5CSE1_T&P questions

Assessment

Quiz

Other

University

Hard

Created by

Gouthami Velakanti

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What will be the output of the following C function?

#include <stdio.h>

  1. enum birds {SPARROW, PEACOCK, PARROT};

  2. enum animals {TIGER = 8, LION, RABBIT, ZEBRA};

  3. int main()

  4. {

  5. enum birds m = TIGER;

  6. int k;

  7. k = m;

  8. printf("%d\n", k);

  9. return 0;

  10. }

0

Compile time error

1

8

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What will be the final value of x in the following C code?

  1. #include <stdio.h>

  2. void main()

  3. {

  4. int x = 5 * 9 / 3 + 9;

  5. }

3.75

Depends on compiler

24

3

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following C code considering the size of a short int is 2, char is 1 and int is 4 bytes?

  1. #include <stdio.h>

  2. int main()

  3. {

  4. short int i = 20;

  5. char c = 97;

  6. printf("%d, %d, %d\n", sizeof(i), sizeof(c), sizeof(c + i));

  7. return 0;

  8. }

a) 2, 1, 2

b) 2, 1, 1

c) 2, 1, 4

d) 2, 2, 8

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value of the following assignment expression?

(x = foo())!= 1 considering foo() returns 2

2

True

1

0

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Comment on the following C statement.

n = 1; printf("%d, %dn", 3*n, n++);

Output will be 3, 2

Output will be 3, 1

Output will be 6, 1

Output is compiler dependent

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the data type returned for the following C function?

  1. #include <stdio.h>

  2. int func()

  3. {

  4. return (double)(char)5.0;

  5. }

char

int

double

multiple type-casting in return is illegal

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this C code?

  1. #include <stdio.h>

  2. int main()

  3. {

  4. float f = 0.1;

  5. if (f == 0.1)

  6. printf("True");

  7. else

  8. printf("False");

  9. }

True

False

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?