The document is a question bank for Unit 2 of a C programming course for the academic year 2024-25. It includes a variety of questions focusing on fundamental concepts such as variables, data types, operators, and control flow in C. Additionally, it highlights repeated questions on local and global variables and covers essential programming tasks like string handling and arithmetic operations.
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 ratings0% found this document useful (0 votes)
31 views1 page
PPL Question Bank Unit 2 2024-25
The document is a question bank for Unit 2 of a C programming course for the academic year 2024-25. It includes a variety of questions focusing on fundamental concepts such as variables, data types, operators, and control flow in C. Additionally, it highlights repeated questions on local and global variables and covers essential programming tasks like string handling and arithmetic operations.
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
You are on page 1/ 1
PPL Question Bank Unit 2 2024-25
Unit No: 2 Sr No. Marks Questions CO BL PI
1 What is an identifier in C? 2 1 2 Give two valid variable names in C. 2 1 3 Write a C program to store a character array (string) and display it using printf. 2 1 4 What is the scope of a variable in C? 2 1 5 What is the difference between local and global variables in C? 2 1 6 What are primitive data types in C? 2 1 7 What is the char data type used in C? 2 1 8 2 Marks How is a string represented in C? 2 1 9 Define constant and variable? 2 1 10 Explain short circuit evaluation with suitable example 2 1 11 What is an arithmetic expression in C? Give example. 2 1 12 What is type conversion in C? 2 1 13 Explain scope and lifetime of variable with suitable example. 2 1 14 Define Associativity and Precedence of operators. 2 1 15 What is Token? What are the different tokens available in C language 2 1 Unit No: 2 Sr No. Marks Questions CO BL PI 1 What is a variable in C? Write a program to declare and initialize variables of int, char, and float types. 2 3 2 Explain the rules for naming identifiers in C with examples. 2 2 3 13 6 diffrence Write a C program to demonstrate the difference between local and global variables. 2 3 4 What are primitive data types in C? Explain each type briefly with an example. 2 2 5 Differentiate between System software vs Application software 2 2 6 Differentiate between Global variable vs local variable 2 2 7 Write a C program to calculate the square of a number entered by the user. 2 2 Write a program to demonstrate the use of the sizeof operator to determine the sizes of different primitive 8 data types in C. 2 3 Explain the difference between int, float, and char data types in C. Write a program that uses these types 9 and performs operations on them. 2 3 Write a program to demonstrate how increment and decrement operators (++, --) work in C. Provide 10 4 Marks examples of their usage. 2 3 11 Write a C program which takes as input P,T,R. Compute the simple interest and display the result. 2 3 12 Write a C program to find the largest of three numbers using ternary operator. 2 3 13 Write a program to demonstrate local and global variable behavior 2 2 What are relational operators in C? Write a program that uses relational operators to compare two numbers 14 and display the result. 2 3 15 Write a C program to display the ASCII value of the character inserted by the user. 2 3 16 What is the difference between a constant and a variable in C? Explain with examples 2 2 17 Write a program to perform addition, subtraction, multiplication, division, and modulus operations. 2 3 18 What is the difference between == and = in C? Provide examples to show how both are used. 2 2 19 What is the modulus operator (%) in C? Write a program to check if a number is even. 2 3 20 What are relational operators in C? Write a program to compare two numbers and display the larger one. 2 3 21 What are assignment operators in C? Write a program to demonstrate the use of += operator. 2 3
Repeated Questions:
Local and Global Variables: This concept is addressed in questions 3, 6, and 13. Other Observations:
The questions cover a range of fundamental C programming concepts, including:
Variables and data types Operators (arithmetic, relational, assignment) Control flow (if-else, ternary operator) Program structure (including variables, input/output, and basic calculations)