Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
61 views

C Programming Important Questions: Unit I

This document outlines important questions about C programming across 5 units: Unit 1 covers basic concepts like the program development cycle, programming languages, C structure, and input/output statements. Unit 2 discusses decision making and looping statements, arrays, string handling, and 1D and 2D array processing. Unit 3 presents built-in functions, user-defined functions, parameter passing, storage classes, unions, and recursion. Unit 4 defines pointers, pointer relations to arrays, pointer to pointers, and dynamic memory allocation. Unit 5 explains the C preprocessor, error handling, command line arguments, file handling, and random access files.

Uploaded by

gayathri deepthi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

C Programming Important Questions: Unit I

This document outlines important questions about C programming across 5 units: Unit 1 covers basic concepts like the program development cycle, programming languages, C structure, and input/output statements. Unit 2 discusses decision making and looping statements, arrays, string handling, and 1D and 2D array processing. Unit 3 presents built-in functions, user-defined functions, parameter passing, storage classes, unions, and recursion. Unit 4 defines pointers, pointer relations to arrays, pointer to pointers, and dynamic memory allocation. Unit 5 explains the C preprocessor, error handling, command line arguments, file handling, and random access files.

Uploaded by

gayathri deepthi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

C Programming Important Questions

UNIT I:

1. Explain program development cycle


2. Discuss about programming languages
3. List the features of good programming language
4. Flow chart and algorithm to find largest no of three
5. Flow chart and algorithm to find the factorial of given number
6. Explain structure of C
7. Steps involved in executing c program
8. Types of operators in C
9. Formatted input and output statements in C

UNIT –II

1. Decision making and Branching


Ans:
a. Simple if statement(logical if statement)
b. If….else statement
c. Else…if ladder
d. Nested if… else
e. Switch statement
2. Explain looping statements
Ans:
a. While structure
b. Do while structure
c. For ststement
3. Explain break and continue statement
4. Write a c program to find the given word is palindrome or not
5. String Handling functions
Ans:
a. Strlen() d. Strcmp() f. Strupr()
b. Strcpy() e. Strrev() g. Strlwr()
c. Strcat()

6. Explain 1D and 2D array and array processing


Ans:
1D Array 2D Array
array- name [subscript] array- name [subscript1] [subscript2]
declaration : declaration :
datatype array-name[size] datatype array-name[row size][column
size]
eg: int mark[10]
eg: int mark[5][2]

Array initialization: Array initialization:


Static datatype array-name[size] ={list Static datatype array-name[row size]
of values} [column size]={list of values}
Eg: Eg: static int mark[3][2]={1,4,6,3,2,8}
Static int age[3]={10,20,30}
Mark[0][0] Mark[0][1]
Age[0] Age[1] Age[2] 1 4
10 20 30 Mark[1][0] Mark[1][1]
6 3
Mark[2][0] Mark[2][1]
2 8

1D array processing 1D array processing


a. Storing values in arrays(Reading) a. Storing values in arrays(Reading)
b. Retriving the stored b. Retriving the stored values(writing)
values(writing)
UNIT-3
1. Explain built-in functions
a. Math functions <math.h>
sin() cos() tan() exp() sqrt()
ceil() floor() abs() fabs() pow()
b. Console input/output functions<conio.h>
getch() clrscr() wherex() gotoxy()
getche() putch() wherey() deline()
c. Standard input/output functions<stdio.h>
scanf() fprintf() getchar() putc() getw() gets()
printf() fscanf() putchar() getc() putw() fabs()
d. Character oriented functions<ctype.h>
isdigir() isupper() toupper() ispunct()
isalpha() islower() tolower()
e. Graphical functions<graphics.h>
initgraph() line() setfillstyle() rectangle() ellipse()
setcolor() setlinestyle() closegraph() cleardevice()
2. Explain the need of user defined functions
Ans:
a. Reduced complexity c. Easy debugging
b. Reusability d. Extendability

3. What are the types of function call (or) Explain parameter passing methods
Ans:
a. Call by value and cal by reference
4. Explain storage classes
Ans:
a. Automatic variables c. Static variables
b. External variables d. Register variables
5. Explain union with example
6. Explain array within structure within example
7. Explain structure definition with example
8. Explain recursion
UNIT-IV
1. Define pointer and give its advantage
2. Give the relation between pointer and array
3. Describe pointers to pointers
4. Types of memory allocation
a. Static memory allocation
b. Dynamic memory allocation
5. Explain the functions used in Dynamic memory allocation
a. malloc()
b. calloc()
c. realloc()
d. free()
UNIT-V
1. Explain C preprocessor
a. Macro substitution directive
b. File Inclusion Directive
c. Compiler control directive
2. Explain Error handling in files
(i) feof() (ii) ferror()
3. Explain command line argument with example
4. Define a file, how a file is opened and closed.
5. Explain random access files
a. ftell()
b. rewind()
c. fseek()

You might also like