C Language Test 3

C Language Test 3

Professional Development

25 Qs

quiz-placeholder

Similar activities

Machine Learning 101

Machine Learning 101

University - Professional Development

20 Qs

BDA Unit Test II

BDA Unit Test II

Professional Development

20 Qs

Python Programming Fundamental

Python Programming Fundamental

Professional Development

20 Qs

CodeHS - Intro to Python - Basics and Console Interaction

CodeHS - Intro to Python - Basics and Console Interaction

9th Grade - Professional Development

20 Qs

Data Structure

Data Structure

Professional Development

20 Qs

coding quiz

coding quiz

5th Grade - Professional Development

20 Qs

วิชาการเขียนโปรแกรมภาษา Pyhton รหัส 32201

วิชาการเขียนโปรแกรมภาษา Pyhton รหัส 32201

Professional Development

20 Qs

Introduction to Machine Learning

Introduction to Machine Learning

University - Professional Development

20 Qs

C Language Test 3

C Language Test 3

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Divakar Bangaru

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

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

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In which of the following languages is function overloading not possible?

C

C++

Java

Python

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following function is used to open a file in C++?

fopen

fclose

fseek

fgets

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following are correct file opening modes in C?

r

rb

w

All of the above.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the return type of the fopen() function in C?

Pointer to a FILE object.

Pointer to an integer.

An integer.

An integer.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

#include <stdio.h>

void solve() {

    int ch = 2;

    switch(ch) {

        case 1: printf("1 ");

        case 2: printf("2 ");

        case 3: printf("3 ");

        default: printf("None");

    }

}

int main() {

    solve();

        return 0;

}

1 2 3 None

2

2 3 None

None

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

#include <stdio.h>

void solve() {

    int x = 1, y = 2;

    printf(x > y ? "Greater" : x == y ? "Equal" : "Lesser");

}

int main() {

    solve();

        return 0;

}

Greater

Lesser

Equal

None of the above.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

#include <stdio.h>

void solve() {

    int n = 24;

    int l = 0, r = 100, ans = n;

    while(l <= r) {

        int mid = (l + r) / 2;

        if(mid * mid <= n) {

            ans = mid;

            l = mid + 1;

        }

        else {

            r = mid - 1;

        }

    }

    printf("%d", ans);

}

int main() {

    solve();

        return 0;

}

5

4

3

6

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?