0% found this document useful (0 votes)
34 views5 pages

Screenshot 2024-12-08 at 8.42.12 PM

Uploaded by

anniemerline2906
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)
34 views5 pages

Screenshot 2024-12-08 at 8.42.12 PM

Uploaded by

anniemerline2906
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
You are on page 1/ 5

UNIT-I

1. What is the difference between assignment and equality operators?


2. What is the purpose of the main function in C?
3. Write a rule to declare a variable.
4. What are the basic data types in C?
5. What is a constant?
6. What is the use of sizeof( ) operator?
7. What is the difference between ++a and a++?
8. Give an Example for Ternary operator.
9. What is type casting? Give an example?
10. Write a Pseudocode to print numbers from 1 to 10.
Part-B
1. Explain a general structure of C program with an example.
2. What is a token? What are different types of tokens available in C language?
3. Draw a flow chart for the following
1. "A student's grade is determined based on their marks. If the marks are:
- 90-100, grade is A
- 80-89, grade is B
- 70-79, grade is C
- 60-69, grade is D
- Below 60, grade is F
Input: Marks
Output: Grade"
2. Draw a flowchart to calculate the area and perimeter of a rectangle.
Input: length and width. Output: area and perimeter.
4. Explain formatted input and output statement with examples.
5. i. Write a program in C to print the numbers from 4 to 9 and their squares
ii. Write a C program to sum of digits of an integer.
6. Write about the building block of an Algorithm with example?
7. Explain the different types of operators used in C with necessary program?
8. i. Write a C program to find the sum of 10 non-negative numbers entered by the user.
ii.Discuss various explicit and implicit type conversions with examples.

UNIT-II
1. What is the difference between a for loop and a while loop?
2. How do you pass parameters to a function in C?
3. Write a C program to print prime numbers using iterative statements
4. What is the general form of function?
5. Write a C program to write sum of two numbers using with return type and without
arguments.
6. How many 'a' will be printed when the following code is executed?
#include <stdio.h>
int main()
{
int i = 0;
char c='a';
while (i < 5)
{
i++;
switch (c)
{
case 'a':
printf("%c", c);
break:
}
}
printf("a\n");
return 0;
}
7. How do you declare a one-dimensional array in C?
8. What is a recursive function in C?
9. Give the general form of array declaration.
10. How do you access elements of a two-dimensional array in C?
PART-B
11. Explain if, if-else, nested if-else and cascaded if-else with examples and syntax.
12. i. Explain the different types of loops in C with syntax.
ii. Show how break and continue statements are used in a C-program, with example.
13. What is an array? How a single dimension and two-dimension arrays are declared and
initialized?
14. Explain in algorithm and write a C program to reorder a one-dimensional array of numbers in
descending order.
15. What is the difference between pass by value and pass by reference? Write the C coding for
swapping two numbers using pass by reference?
16. What is recursion? Write a C program to display Fibonacci series using Recursive function.
17. Explain the purpose of function prototype. And specify the difference between user defined
and built-in functions.
18. Write a C program to implement a simple banking system using functions and arrays.

UNIT-III
1. What is a string in C?
2. What is the difference between a string and a character array in C?
3. What is the purpose of the strlen() function in C?

4. Give an example of initialization of string array.


5. Write the syntax of pointers.
6. How to use pointers?
7. Write a program to declare a pointer to a pointer
8. How do you declare a pointer variable in C?
9. How do you perform pointer arithmetic in C?
10. What is the purpose of the Dangling pointer in C?

11. What is the output for the below program

#include <stdio.h>
int main() {
int arr[] = {1, 2, 3, 4, 5};
int *p = arr;
int i;
for (i = 0; i < 5; i++) {
printf("%d ", *p);
p++;
}
return 0;
}
PART-B
1. Write a C program to reverse a string without using string handling functions.
2. Write a C Program to find length of a string without using library functions.
(ii) Write a C program to check whether a given string is a palindrome.
3. Write the following programs:
To sort the given set of strings alphabetically.
Write a C program to find transpose of a matrix.

4. Examine the following:


(i) getc() (ii)getchar() (iii)gets() (iv)putc() (v) putchar() (vi) puts()
5. What are pointers? When and why they are used? Explain in detail with sample programs.
6. How do you use a pointer to a function? When would you use a pointer to a function?
7. Explain the use of pointers in array handling with an example.
8. What is pointer? Give the advantages and disadvantages of pointer data type.

UNIT-IV
1. Define typedef with syntax and an example.
2. Give the syntax for structure and its definition.
3. Write the rules for declaring a structure.
4. Write the three ways to pass structure variables as argument to a function.
5. How structure elements can be accessed?
6. Define nested structure.
7. What is an enumeration? Give an example.
8. Why do we need Union in C programming?
9. Differentiate Structure and Union in C.
10. What is the output for the below program?
#include <stdio.h>
enum Color {RED, GREEN, BLUE};
int main() {
printf("RED = %d\n", RED);
printf("GREEN = %d\n", GREEN);
printf("BLUE = %d\n", BLUE);
return 0;
}

PART-B
1. What is a structure? Create a structure with data members of various types and declare two
structure variables.
2. i. Explain the concept of structure within structure with suitable program.
ii. Define and declare a structure to store date, which includes day, month and year.
3. Discuss about any two possible ways of passing structures to function.
4. Explain how members of a Structure are accessed using a program code.
5. Explain union of structure Give an example also mention the size of memory that will be
allocated for your example.
6. Explain Structures inside Union and Union inside Structures with example.
7. What are self-referential structures? Explain with suitable examples.
8. Implement a union BankAccount with members Account no, balance and Account holder.
Write a C Program to perform banking operations (Deposit, Withdraw and Check
Balance)

UNIT-V
1. What is a file?
2. How do you open a file?
3. Mention any five file functions.
4. What is sequential access file?
5. Write a program in C language to create a data file.
6. What do you mean by Command line arguments?
7. Define file pointer in C.
8. Compare text file and binary file.
9. What are the basic operations performed on a file?
10. Why files are needed?

PART-B
1. Explain the types of file processing with necessary examples.
2. Write the case study of “How sequential access file is differing from random access file”.
3. Write a program that appends one file at the end of another.
4. Explain in detail random access in files along with the functions used for the same in C.
Give suitable examples.
5. What is dynamic memory allocation? Explain various C functions that are used for
dynamic memory allocation with examples.
6. Distinguish between static memory allocation and dynamic memory allocation in C.
7. Distinguish between malloc() and calloc() functions in C.
8. Write a program that will receive a filename and a line of text as command line arguments
and write the text to the file.

PART-C

1. i. Write a program to read characters until a '*' is entered. Simultaneously store


these characters in a file.
ii. Write a program to accepts an integer value from 0 to 999. Display the value
of the number read in words. (Hint: 753 Seven Hundred Fifty-Three).
2. Declare the C union for the following scenario:
i. College contains the following fields: College code (2characters), College Name,
year of establishment, number of courses.
ii. Each course is associated with course name (String), duration, number of students.
(A College can offer 1 to 50 such courses).
3. Online Shopping cart with the following conditions:
i. If the total bill is less than Rs.100, a 5% discount is applied.
ii. If the total bill is between Rs.100 and Rs.500, a 10% discount is applied.
iii. If the total bill is greater than Rs.500, a 15% discount is applied.
Write a C program to simulate these decision-making processes

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy