The document consists of questions related to programming in C and data structures, categorized into three sections: short answer, long answer, and specific programming tasks. It covers fundamental concepts such as loops, operators, data types, control structures, and the structure of C programs. Additionally, it includes practical programming exercises and theoretical questions to assess understanding of C programming principles.
The document consists of questions related to programming in C and data structures, categorized into three sections: short answer, long answer, and specific programming tasks. It covers fundamental concepts such as loops, operators, data types, control structures, and the structure of C programs. Additionally, it includes practical programming exercises and theoretical questions to assess understanding of C programming principles.
1. C is a structured programming language? Justify. 2. Write a ‘C’ program to find the largest among two numbers using Conditional Operator. 3. What is difference between while and do-while loops? 4. Discuss about switch statement with an example. 5. What is the difference between assignment and equality operation? 6. Explain the terms character set, tokens, constant and variables. 7. Distinguish between the purpose of continue and break statement. 8. What is a flowchart? Explain with one example. 9. What is the difference between low-level and high-level language and uses of them? 10. Explain about the break and continue with example. 11. Differentiate between for loop and while loop. 12. Why C is called a middle level programming language? 13. Explain with an example how a nested if-else structure is written. 14. What is ternary operator? Explain with an example. 15. Explain the use of break statement with an example. 16. The main() is which type of function? Justify your answer. 17. Define C token. 18. Differentiate between variable and constant. 19. What are preprocessor directives? Write any two uses of it with examples. 20. What is the use of #define preprocessor.
Short answer type questions: (6 marks each)
1. What are variables and constants? What are the rules for declaring the variables? 2. Enlist the different types of operators used in C and specify its associativity? (OR) What do you mean by operator precedence and associativity? Explain different types of operators used in c with examples. 3. Write a program to add all the digits of a number using do-while loop. 4. What are the looping statements in C? Explain with suitable examples. (OR) Explain the different types of loop in C with syntax and examples. 5. Explain the basic structure of C program with an example. 6. What is a token? What are the different types of tokens available in C language? Explain. 7. Explain formatted input and output statement with examples. 8. What is an identifier? What are the rules to construct identifier? Classify the following as valid/invalid identifiers. i) num2 ii) $num1 iii) +add iv) a_2 v) 199_space vi) num 9. What are the basic datatypes available in C? Write the significance of each datatype. 10. Define the following terms with an example: i)Algorithm ii)Flowchart iii)Pseudocode
Long answer type questions: (10 marks each)
1. Define keyword and identifier in C. What is data type? Explain about different data types with examples. 2. Differentiate between Continue and Break statement. Write a C program to calculate the grade of a student by considering the following range of marks using switch-case statement. O, 90 ≤ Marks ≤100 E, 80 ≤Marks < 90 A, 70 ≤Marks < 80 Grades= B, 60 ≤Marks < 70 C, 50 ≤Marks < 60 D, 40 ≤Marks < 50 F, Otherwise 3. Explain different types of operators used in C, with suitable examples. 4. What do you mean by control structure in C? Explain branching statements with syntax and example. 5. a) Explain briefly the history of C language? Write the characteristics and uses of C language? b) With the help of a flowchart explain the steps followed in the execution of a C program.