0% found this document useful (0 votes)
2 views15 pages

C Programming Question

The document outlines a comprehensive curriculum for learning C programming, covering topics such as computer languages, program development cycles, data types, functions, arrays, structures, and memory management. Each module includes definitions, explanations, and examples, along with important questions and programs for practice. The curriculum is structured to build foundational knowledge and practical skills in C programming.

Uploaded by

bhimangouda58
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)
2 views15 pages

C Programming Question

The document outlines a comprehensive curriculum for learning C programming, covering topics such as computer languages, program development cycles, data types, functions, arrays, structures, and memory management. Each module includes definitions, explanations, and examples, along with important questions and programs for practice. The curriculum is structured to build foundational knowledge and practical skills in C programming.

Uploaded by

bhimangouda58
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

MODULE-1

Introduction to Computing
1. Define computer languages. Explain:
o Machine language
o Assembly language
o High-level language
2. Explain the steps involved in creating and running a C program.
3. Explain the program development cycle/System Development Life Cycle.
4. Differentiate between:
o Compiler and Interpreter
o High-level and low-level languages
5. Explain the phases of program execution in C.
6. Write notes on:
o Source code
o Object code
o Executable file

Overview of C
7. Explain the history and features of C language.
8. Why is C called:
o A middle-level language?
o A structured language?
o A programmer’s language?
9. Differentiate between compiler and interpreter.
10. Explain the structure/form of a C program.

Example structure:
#include<stdio.h>
int main()
{
printf("Hello World");
return 0;
}

11. Explain header files and library functions in C.


12. What is linking? Explain library and linking process.
13. Explain separate compilation in C.
14. Explain the process of compiling a C program.
15. Explain C memory map with neat diagram.

Expressions & Data Types


16. Explain basic data types in C.
17. Explain modifiers in C:
o short
o long
o signed
o unsigned
18. Explain identifier naming rules in C.
19. Define variables. Explain variable declaration and initialization.
20. Explain the four scopes in C:
o Block scope
o Function scope
o File scope
o Function prototype scope
21. Explain type qualifiers:
o const
o volatile
22. Explain storage class specifiers:
o auto
o register
o static
o extern
23. Differentiate between local and global variables.
24. Explain constants in C with examples.
25. Explain operators in C:

 Arithmetic
 Relational
 Logical
 Assignment
 Bitwise
 Conditional
 Increment/decrement

26. Explain operator precedence and associativity.


27. What are expressions? Explain different types of expressions in C.
28. Explain type conversion and type casting.

IMPORTANT QUESTION FROM THIS UNIT


1. Explain structure of C program with example.
2. Explain compilation process in C.
3. Explain C memory map with diagram.
4. Explain storage classes in C.
5. Explain operators and precedence.
6. Differentiate compiler and interpreter.
7. Explain scopes and lifetime of variables.
8. Explain data types and modifiers.

Important Programs from This Unit

Practice These
1. Hello World program
2. Addition of two numbers
3. Swap two numbers
4. Simple calculator
5. Area of circle
6. Celsius to Fahrenheit conversion
7. Program using different operators
8. Program showing type casting
Module-2
1. Console I/O Functions
1. Explain console input and output in C.
2. Explain reading and writing characters in C with examples.

Functions:

getchar()
putchar()

3. Explain reading and writing strings in C.


Functions:
gets()
puts()
fgets()

4. Explain formatted console I/O in C.


5. Explain printf() function with syntax and examples.
6. Explain format specifiers used in printf() and scanf().

Most important:

 %d
 %f
 %c
 %s
 %lf
 %u

7. Explain scanf() function with syntax and examples.


8. Differentiate between:
o printf() and scanf()
o getchar() and putchar()
o gets() and puts()
9. Explain escape sequences in C.
Examples:
\n
\t
\b
\r

10. Explain formatted input and output with examples.


2. Statements in C

1. Explain true and false values in C.


2. What is the role of zero and non-zero in C conditions?
3. Explain Boolean expressions in C.
4. Explain if statement with syntax and example.
5. Explain if-else statement.
6. Explain nested if statement.
7. Explain else-if ladder with example.
8. Explain switch statement with syntax and flowchart.
9. Differentiate between:if-else and switch ,nested if and else-if ladder.

Iteration Statements
1. Explain while loop with syntax and example.
2. Explain do-while loop.
3. Explain for loop.
4. Differentiate between:
o while and do-while
o for and while
5. Explain nested loops.
6. Explain infinite loop

Jumping Statements
1. Explain break statement with example.
2. Explain continue statement.
3. Explain goto statement.
4. Explain return statement.
5. Differentiate between:
o break and continue
o goto and break
Expression Statements & Block Statements
1. What are expression statements? Explain with examples.
2. Explain block statements in C.
3. Explain compound statements.
4. What is the use of braces {} in C?

Important question from this unit


1. Explain formatted console I/O functions.
2. Explain printf() and scanf() with examples.
3. Explain selection statements in C.
4. Explain looping statements with examples.
5. Explain switch statement with syntax and flowchart.
6. Differentiate all looping statements.
7. Explain jump statements with examples.

Important Programs from this unit


 Even/Odd
 Largest of 3 numbers
 Leap year
 Factorial
 Fibonacci
 Prime number
 Palindrome
 Armstrong number
 Calculator using switch
 Pattern printing
Module-3
1. Arrays and Strings Single-
Dimension Arrays
1. Define an array. Explain declaration and initialization of arrays.
2. Explain single-dimensional arrays with syntax and example.
3. Explain memory representation of arrays.
4. Explain advantages and disadvantages of arrays.
5. Differentiate between arrays and variables.
6. Explain how arrays are passed to functions.
7. Explain generating a pointer to an array.
8. Explain relationship between arrays and pointers.

Strings
1. Define string in C.
2. Explain declaration and initialization of strings.
3. Differentiate between character array and string.
4. Explain standard string functions:

strlen()
strcpy()
strcat()
strcmp()

5. Explain passing strings to functions.


6. Explain string handling in C.

Two-Dimensional Arrays
1. Explain two-dimensional arrays with syntax.
2. Explain initialization of 2D arrays.
3. Explain memory representation of 2D arrays.
4. Explain multidimensional arrays.
5. Differentiate between 1D and 2D arrays.

Array Initialization & Variable-Length Arrays


1. Explain array initialization with examples.
2. Explain partial initialization of arrays.
3. What are variable-length arrays (VLA)?
4. Explain advantages of VLA.
5. Differentiate between fixed-size arrays and VLA.

Pointers
9. What are pointers? Explain with syntax and example.
10. Explain pointer variables.
11. Explain declaration and initialization of pointers.
12. Explain address operator (&) and indirection operator (*).
13. Explain pointer expressions.
14. Explain pointer arithmetic.
15. Explain relationship between pointers and arrays.
16. Differentiate between pointers and arrays.
17. Explain multiple indirection (pointer to pointer).
18. Explain initializing pointers.
19. Explain NULL pointers.
20. Explain dangling pointers.

IMPORTANT QUESTION FROM THIS UNIT


1. Explain single-dimensional arrays with example.
2. Explain passing arrays to functions.
3. Explain strings and string functions.
4. Explain two-dimensional arrays with matrix programs.
5. Explain pointers and pointer operators.
6. Explain relationship between arrays and pointers.
7. Explain pointer arithmetic.
8. Explain multiple indirection with example
IMPORTANT PROGRAM TO PRACTICE FROM THIS
Arrays

 Largest element
 Sorting
 Searching
 Matrix multiplication
 Matrix transpose

Strings

 String reverse
 Palindrome string
 String compare
 String concatenate

Pointers

 Swapping using pointers


 Array using pointers
 Pointer arithmetic
 Pointer to pointer
Module-4
1. Functions in C

Basics of Functions
1. Define a function. Explain the general form of a function.
2. Explain:
o Function declaration
o Function definition
o Function call
3. Explain advantages of using functions.
4. Differentiate between:
o Library functions and user-defined functions
o Declaration and definition
5. Explain scope of a function.
6. Explain local and global variables with examples.
7. Explain lifetime and visibility of variables.

Function Arguments
1. Explain function arguments in C.
2. Differentiate between:
o Actual parameters and formal parameters
3. Call by value and call by reference
4. Explain passing arrays to functions.
5. Explain passing pointers to functions.

ARGC AND ARGV


1. Explain command-line arguments in C.
2. Explain:
argc
argv

3. Write syntax of main() with command-line arguments.


4. Explain how command-line arguments are passed to programs.

The return Statement


1. Explain return statement with examples.
2. What does main() return?
3. Differentiate between:
o return
o break
o continue

Recursion
1. Define recursion. Explain recursive functions.
2. Differentiate between recursion and iteration.
3. Explain advantages and disadvantages of recursion.
4. Explain stack memory in recursion.

Function Prototypes
1. Explain function prototypes with syntax.
2. Why are function prototypes required?
3. Explain function declaration before main().

Variable-Length Parameter Declarations


1. Explain variable-length parameter declarations.
2. Explain variable-length arrays in functions.
3. Write examples of variable-length parameters.

INLINE Keyword
1. Explain inline keyword in C.
2. Advantages and disadvantages of inline functions.
3. Differentiate between normal and inline functions

Pointers to Functions
1. Explain pointers to functions with syntax.

2. How are functions called using function pointers?

3. Explain applications of function pointers.

4. Differentiate between:
o Pointer to variable
o Pointer to function
Dynamic Memory Allocation
1. Explain dynamic memory allocation in C.
2. Explain memory allocation functions:

malloc()
calloc()
realloc()
free()
3. Differentiate between:
o malloc() and calloc()
o Static and dynamic memory allocation
o Explain syntax and use of malloc().
4. Explain memory deallocation using free().
5. Explain memory reallocation using realloc().

IMPORTANT QUESTION FROM THIS UNIT


6. Explain functions in C with syntax and example.
7. Explain call by value and call by reference.
8. Explain recursion with recursive factorial/Fibonacci.
9. Explain command-line arguments.
10. Explain function prototypes.
11. Explain function pointers with example.
12. Explain dynamic memory allocation functions.
13. Differentiate malloc() and calloc().

IMPORTANT PROGRAM FROM THIS MODULE

 Factorial using function


 Fibonacci using recursion
 GCD using function
 Swap using call by reference
MODULE 5

Basics of Structures
1. Define structure in C with syntax and example.
2. Explain declaration and initialization of structures.
3. Explain accessing structure members using:
4. Explain advantages of structures.
5. Differentiate between:
o Structure and array
Structure and union
Arrays of Structures
1. Explain arrays of structures with syntax and example.
2. How are arrays of structures useful in real-world applications?
3. Explain memory allocation in arrays of structures.

Passing Structures to Functions


1. Explain passing structure variables to functions.
2. Differentiate between:
o Passing individual members
o Passing entire structure
3. Explain call by value for structures.

Structure Pointers
Most Important Theory Questions
1. Explain structure pointers with syntax.
2. Explain arrow operator:->
3. Differentiate between:
o Dot operator (.)
o Arrow operator (->)
4. Explain accessing structure members using pointers.

Nested Structures
1. Explain structures within structures (nested structures).
2. Explain arrays within structures.

3. Explain structures containing arrays.


Unions
1. Define union in C with syntax and example.
2. Differentiate between:
Differentiate between:

o Structure and union.


3. Explain memory allocation in unions.
4. Explain advantages and disadvantages of unions.
5. Explain applications of unions.

Bit-Fields
1. What are bit-fields in C?
2. Explain declaration and use of bit-fields.
4. Explain advantages of bit-fields.
5. Explain memory saving using bit-fields.

Enumerations (enum)
1. Define enumeration with syntax and example.
a. Explain advantages of enum.
b. Differentiate between:
i. enum and macro
ii. enum and constants
c. Explain default values in enumerations.

sizeof Operator & Portability


2. Explain sizeof operator with examples.
3. Explain how sizeof improves portability.
4. Write programs using sizeof.

typedef
1. Define typedef with syntax and example.
2. Explain advantages of typedef.
3. Differentiate between:
a. typedef
b. #define
4. Explain typedef with structures.

IMPORTANT QUESTION FROM THIS MODULE


1. Explain structures with syntax and example.
2. Explain arrays of structures.
3. Explain passing structures to functions.
4. Explain structure pointers and arrow operator.
5. Differentiate structure and union.
6. Explain unions with example.
7. Explain enumerations in C.
8. Explain typedef with example

IMPORTANT PROGRAM FROM THIS UNIT


Structures

 Student record
 Employee database
 Nested structure

 Array of structures

Unions

 Basic union program


 Structure vs union memory example

Enum & typedef

 Days using enum


 typedef structure example

You might also like