Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 21 What is the output of the following code snippet? union my_union { int x; char ch; }var; var.ch = 'A'; printf(%d, var.x); A.

QUESTION 21

  1. What is the output of the following code snippet?

    union my_union

    {

    int x;

    char ch;

    }var;

    var.ch = 'A';

    printf("%d", var.x);

    A.

    A

    B.

    Garbage Value

    C.

    65

    D.

    120

  2. QUESTION 23

  3. What is the output of following code snippet?

    float a = 5, b = 2;

    int c;

    c = a%b ;

    printf ( "%d", c );

    A.

    2.5

    B.

    Compile-time Error

    C.

    2

    D.

    Garbage Value

  4. 3 points

    QUESTION 24

  5. Which of the following statements is true for the following program?

    void main( )

    {

    int x = 10;

    int y = 100%90;

    for ( int i = 1; i <= 10; i++ );

    if ( x != y );

    printf ( "x = %d y = %d", x, y );

    }

    A.

    The printf( ) function is called 10 times.

    B.

    The program will produce the output x = 10 y = 10.

    C.

    The printf( ) function is called infinite times.

    D.

    The program will not produce any output.

  6. 4 points

    QUESTION 25

  7. Which of the following statement is true about a for loop used in a C program? This question has multiple choices (more than one answer).

    A.

    for loop works faster than a while loop.

    B.

    All things that can be done using a for loop can also be done using a while loop.

    C.

    for ( ; ; ) implements an infinite loop.

    D.

    for loop can be used if we want statements in a loop to get executed at least once.

    E.

    for loop works faster than a do-while loop.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions

Question

=+(0

Answered: 1 week ago