Learning C

                     

Course link: https://www.linkedin.com/learning/learning-c-5

Question 1 of 27
What is happening here?

x=x+1

The value of variable x is assigned the value 1.
The results are unpredictable.
The value of variable x is increased by 1.
The compiler is poised to error, as you cannot self-modify a variable.

The value of variable x is increased by 1.

Question 2 of 27
What can be said about the switch statement’s comparison?

The switch statement doesn’t compare values.
The switch statement’s comparison is made by the case statements.
Unlike if, the switch statement uses the break keyword instead of else.
The break keyword must be used to ensure that each case statement is evaluated.

The switch statement’s comparison is made by the case statements.

Question 3 of 27
Are the conditions inside a for loop separated by semicolons?

Yes. Two semicolons separate the three parts of the loop’s conditions.
No. When a condition isn’t necessary, you don’t need to use the semicolon or comma.
Yes. Up to two semicolons can be used, fewer if the conditions are set previously.
No. You can use either semicolons and commas to separate the conditions.

Yes. Two semicolons separate the three parts of the loop’s conditions.

Question 4 of 27
Before you can re-assign a variable’s value, what must you do?

Nothing needs to be done before you re-assign a variable’s value.
Re-declare the variable as a specific data type.
Ensure that the old data is saved in a new variable.
Reset the variable’s data to zero or the null character.

Nothing needs to be done before you re-assign a variable’s value.

Question 5 of 27
Darryl has chosen to use scanf() to input a line of text. Why is this a bad decision?

The scanf() function stops reading text input at the first whitespace character.
It isn’t a bad decision. The scanf() function is more than capable of reading any string.
The scanf() function assigns values only to single variables and a string is a character array.
The scanf() function cannot read strings.

The scanf() function stops reading text input at the first whitespace character.

Question 6 of 27
Where is a good spot to insert the new line escape sequence?

after the backslash character
anywhere in a string you want a new line of text to appear
after the semicolon at the end of a statement
at the end of the printf() statement, because printf() doesn’t automatically append a new line

anywhere in a string you want a new line of text to appear

Question 7 of 27
What is a C language variable?

a constant value that can change
the result of an assignment expression
a number or single character
a container for a type of data

a container for a type of data

Question 8 of 27
What is the array notation equivalent of this expression?

*(array+3)

array[3]
array[3][0]
*array[3]
The expression cannot be translated into array notation.

array[3]

Question 9 of 27
What happens when you add 1 to the address stored in integer pointer ptr?

It adds the integer value 1 to the address stored in the pointer variable.
It causes an error as you cannot manipulate memory stored in a pointer.
It adds to the address stored the size of one integer variable.
It adds one byte (memory location) to the address stored in ptr.

It adds to the address stored the size of one integer variable.

These answers are for Learning in C from Linkedin

Question 10 of 27
Beyond documenting your code, how else can comments be used?

They can be used for pretty decorations.
They can help link other source code files without compiling them directly.
You can comment out part of the code.
You can offer instructions to the precompiled.

You can comment out part of the code.

Question 11 of 27
To obtain the proper amount of memory required, which argument should you place in the malloc() function?

the size of the data type required multiplied by the number items
a pointer of the data type required multiplied by the number of items
the number of bytes required
a pointer

the size of the data type required multiplied by the number items

Question 12 of 27
In C language, what do statements end with?

backticks
semicolons
all of these answers
parentheses

semicolons

Question 13 of 27
How does the compiler help you find errors in your code?

The error is color-coded in the editor.
The compiler merely reports the error, but does not assist beyond that.
It lists the error line number and a brief description.
Only the linker provides error messages, not the compiler.

It lists the error line number and a brief description.

Question 14 of 27
When setting a two-dimensional character array, how is the size (number of characters) in the second dimension set?

The number of elements are equal to the average size of all the strings.
to the length of the longest string; you don’t need to add one because the first array element is zero
to the length of the longest string, plus one for the null character
The second dimension is equal to the number of strings, plus one.

to the length of the longest string, plus one for the null character

Question 15 of 27
______ operators give variables their values.

Mathematical
Relational
Assignment
Conditional

Assignment

Question 16 of 27
Which statement is false?

A pointer is a variable.
The pointer may or may not be prefixed by the * operator.
A pointer holds a memory location, an address.
A pointer is the same as the ampersand, the address-of operator.

A pointer is the same as the ampersand, the address-of operator.

Question 17 of 27
What are four pieces of information you can gather about a variable?

data type, name, size in bytes, and location in memory
data type, name, sizeof operator, and ampersand operator
You can obtain only three pieces of information about a variable: its data type, name, and value.
data type, name, initial value, storage size, and location in memory

data type, name, size in bytes, and location in memory

Question 18 of 27
There are far more ____ than keywords.

mathematical operators
conditional operators
functions

functions

These answers are for Learning in C from Linkedin

Question 19 of 27
What is a key part of the C language?

functions
data types
operators
all of these answers

all of these answers

Question 20 of 27
C language statements end with a _____.

set of curly brackets or braces
period
semicolon

semicolon

Question 21 of 27
Assume that 1 is TRUE and 0 is FALSE. Which logical evaluation is TRUE?

!(TRUE || FALSE)
FALSE || FALSE
!FALSE
TRUE && FALSE

!FALSE

Question 22 of 27
What is the advantage of an IDE?

It provides a central location for all programming activities.
The IDE offers a fancy editor with highlighting and other useful features.
The IDE helps compile and link your code.
The IDE is best used for larger projects or when you need to debug your code.

It provides a central location for all programming activities.

Question 23 of 27
Yuri wants to use constant Y in a for loop. Which option is valid?

for(x=1;xy;x++)
for(y=0;y20;y++)
for(y=0;yx;x++)
all of these answers

for(x=1;xy;x++)

Question 24 of 27
Which statement is false?

The value returned by a function must be used elsewhere in the code.
You can return multiple values from a function.
A function can act as the data type it returns. For example, a function can appear within another function.
The main() function has arguments, though they don’t need to be specified unless they’re used.

You can return multiple values from a function.

Question 25 of 27
Which statement is true?

A function’s arguments must all be of the same variable type.
none of these answers
All arguments passed to a function must be variables.
Arguments passed to a function are treated as variables within the function.

Arguments passed to a function are treated as variables within the function.

Question 26 of 27
Can you display a single character as a value?

Yes, by changing the printf() function’s placeholder from %c to %d.
No, characters and values are separate data types in C.
No, though you can use a chtype function to convert digits 0 to 9 to their numeric counterparts.
Yes, by using a chtype function that outputs the character’s ASCII value.

Yes, by changing the printf() function’s placeholder from %c to %d.

Question 27 of 27
What value does a void function return?

any value
no value
The return keyword sets the value, which can be a variable, constant, or another value depending on the function’s purpose.

no value


These answers are for Learning in C from Linkedin

Course link: https://www.linkedin.com/learning/learning-c-5

Check all answers of Advance Your Skills in C and C++ from here

* The material and content uploaded on this website are for general information and reference purposes only. Please do it by your own first.

https://progies.in/answers/linkedin-learning/advance-your-skills-in-c-and-cpp