Search Header Logo

Fundamentals of C and Python

Authored by Anil N

English

University

Used 1+ times

Fundamentals of C and Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to output 'Hello, World!' in C?

#include \nint main() {\n printf("Hello, World!\n");\n return 0;\n}

print('Hello, World!');

echo 'Hello, World!';

System.out.println('Hello, World!');

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a variable in Python?

You declare a variable in Python by using the syntax: variable_name = value.

variable_name : value

value = variable_name

declare variable_name as value

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'main' function in C?

The 'main' function is the entry point of a C program.

The 'main' function is where all functions are declared.

The 'main' function is responsible for memory management.

The 'main' function is used for defining global variables.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create a list in Python?

You create a list in Python using curly braces, e.g., my_list = {item1, item2, item3}.

You create a list in Python using square brackets, e.g., my_list = [item1, item2, item3].

You create a list in Python using parentheses, e.g., my_list = (item1, item2, item3).

You create a list in Python by using the list() function, e.g., my_list = list(item1, item2, item3).

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between '==' and '===' in JavaScript?

'==' checks for object identity while '===' checks for value equality

'==' is faster than '==='

'==' is used for strict comparisons while '===' is for loose comparisons

The difference is that '==' allows type coercion while '===' does not.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write a comment in C?

Use '/*' for single-line comments

Use '//' for multi-line comments

Use '#' for comments

Use '//' for single-line comments and '/* comment */' for multi-line comments.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code: print(2 ** 3) in Python?

8

9

4

6

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?