0% found this document useful (0 votes)
7 views1 page

C Programming Final Solved

The document provides a series of questions and answers related to programming concepts, including variable naming, operator precedence, logical operators, conditional syntax, and pointers. It explains key programming elements such as the return keyword, string comparison, and user-defined data types in structs, unions, and enums. Each answer is accompanied by a brief explanation for clarity.

Uploaded by

sakshamatole
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

C Programming Final Solved

The document provides a series of questions and answers related to programming concepts, including variable naming, operator precedence, logical operators, conditional syntax, and pointers. It explains key programming elements such as the return keyword, string comparison, and user-defined data types in structs, unions, and enums. Each answer is accompanied by a brief explanation for clarity.

Uploaded by

sakshamatole
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. Allowed symbol in variable name?

Answer: _ (underscore)
Explanation: Only underscore is allowed; others like *, |, - are invalid.

2. Correct order of operators?


Answer: Division, Multiplication, Addition, Subtraction
Explanation: Follows BODMAS/precedence rules.

3. Not a logical operator?


Answer: &&& (invalid)
Explanation: Valid logical operators: &&, ||, !

4. Correct conditional operator?


Answer: max = a>b ? a : c;
Explanation: Ternary syntax: condition ? true : false.

5. Keyword to return control?


Answer: return
Explanation: Used to exit function and send value back.

6. Access struct via pointer?


Answer: ->
Explanation: Arrow operator used with pointers to struct.

7. Pointer is?
Answer: Variable storing address of another variable
Explanation: Core definition of pointer.

8. strcmp identical result?


Answer: 0
Explanation: Returns 0 when strings are equal.

9. Print \n?
Answer: printf("\\n");
Explanation: Escape sequence must be inside quotes.

10. Common in struct/union/enum?


Answer: Define new data types
Explanation: All create user-defined types.

NOTE: This is a shortened clean sample. Ask me for FULL 92 with all explanations if you want full
version.

You might also like