Search Header Logo

TPEC4

Authored by Revathy BD

Computers

Professional Development

Used 4+ times

TPEC4
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the result of the following code snippet?

#include <stdio.h>

void solve()

{

char ch[10] = "abcdefghij";

int ans = 0;

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

{

ans += (ch[i] - 'a');

}

printf("%d", ans);

}

int main()

{

solve();

return 0;

}

45

35

20

100

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

#include "stdio.h"

int main()

{

int x, y = 5, z = 5;

x = y == z;

printf("%d", x);

getchar();

return 0;

}

0

1

5

Compiler Error

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt


How is an array initialized in C language?


int a = {1, 2, 3};

int a(3) = [1, 2, 3];

int a[] = new int[3];

int a[3] = {1, 2, 3};

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

How is the 3rd element in an array accessed based on pointer notation?


*(a + 3)

*a + 3

&(a + 3)

(a + 3)

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt


How to find the length of an array in C?

sizeof(a[0])

sizeof(a) / sizeof(a[0])

sizeof(a) * sizeof(a[0])

sizeof(a)

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output of the following code snippet?

#include <stdio.h>

#include<stdlib.h>

void set(int to)

{

to = (int)malloc(5 sizeof(int));

}

void solve()

{

int ptr; set(ptr); ptr = 10;

printf("%d", ptr);

}

int main()

{

solve();

return 0;

}

10

The program may crash.

Cannot Say

Garbage Value

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

From following which is not the operation of data structure?

Operations that manipulate data in some way

Operations that perform a computation

Operations that check for syntax errors

Operations that check for syntax errors

Access all questions and much more by creating a free account

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

Already have an account?