CPR Quiz_chapter 5_structure

CPR Quiz_chapter 5_structure

Professional Development

10 Qs

quiz-placeholder

Similar activities

C Operators

C Operators

University - Professional Development

15 Qs

Arrays & Strings using C

Arrays & Strings using C

Professional Development

15 Qs

Promos and Channels

Promos and Channels

Professional Development

15 Qs

MicroController & Interfacing --Module 1 (Test 2)

MicroController & Interfacing --Module 1 (Test 2)

Professional Development

10 Qs

DAY 1 - C& C++ Assessment _10th June 24

DAY 1 - C& C++ Assessment _10th June 24

Professional Development

10 Qs

Evaluación Express OFerta Comercial Multimedia 19.09.20200

Evaluación Express OFerta Comercial Multimedia 19.09.20200

Professional Development

14 Qs

Nakinig ka ba kahapon?

Nakinig ka ba kahapon?

Professional Development

15 Qs

Desafío Java fácil

Desafío Java fácil

Professional Development

10 Qs

CPR Quiz_chapter 5_structure

CPR Quiz_chapter 5_structure

Assessment

Quiz

Professional Development

Professional Development

Practice Problem

Medium

Created by

Sheetal Pawar

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following accesses a variable in structure b?

->var;

b.var;

b-var;

b>var;

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is a properly defined struct?

struct {int a;}

struct a_struct {int a;}

struct a_struct int a;

struct a_struct {int a;};

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which properly declares a variable of struct foo?

struct foo;

struct foo var;

foo;

int foo;

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What is the output of this C code?

#include <stdio.h>

void main()

{

struct student

{

int no;

char name[20];

};

struct student s;

s.no = 8;

printf("%d", s.no);

}

Nothing

Compile time error

Junk

8

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

#include<stdio.h>

struct Point

{

int x, y, z;

};

int main()

{

struct Point p1 = { 0, 1, 2};

printf("%d %d %d", p1.x, p1.y, p1.z);

return 0;

}

Compiler Error

2 0 1

0 1 2

2 1 0

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What is the output of C program.?


int main()

{

struct ship

{

int size;

char color[10];

}boat1, boat2;

boat1.size=10;

boat2 = boat1;

printf("boat2=%d",boat2.size);

return 0;

}

boat2=0

boat2=-1

boat2=10

Compiler error

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What is the output of C program with structures.?


int main()

{

struct tree

{

int h;

}

struct tree tree1;

tree1.h=10;

printf("Height=%d",tree1.h);

return 0;

}

Height=0

Height=10

Height=

Compiler error

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?