TPEC4

TPEC4

Professional Development

15 Qs

quiz-placeholder

Similar activities

PSPC1

PSPC1

Professional Development

20 Qs

Skill Development - Debugging Practice1

Skill Development - Debugging Practice1

10th Grade - Professional Development

10 Qs

Linked List

Linked List

Professional Development

15 Qs

Coding Fundamentals in C

Coding Fundamentals in C

6th Grade - Professional Development

12 Qs

C Language Basic Quiz

C Language Basic Quiz

7th Grade - Professional Development

10 Qs

C# Quiz

C# Quiz

Professional Development

10 Qs

C String Array MCQs

C String Array MCQs

Professional Development

10 Qs

c program -basic

c program -basic

Professional Development

10 Qs

TPEC4

TPEC4

Assessment

Quiz

Computers

Professional Development

Medium

Created by

Revathy BD

Used 4+ times

FREE Resource

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

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?