[go: up one dir, main page]

0% found this document useful (0 votes)
5 views2 pages

C Lab Practical Question Printout

The document outlines a series of programming exercises covering basic concepts such as variable types, arithmetic operations, control structures, loops, arrays, strings, functions, recursion, structures, unions, dynamic memory allocation, and file handling. Each section includes specific tasks for writing programs, such as calculating gross salary, finding the greatest of three numbers, and performing operations on arrays and strings. The exercises are designed to enhance programming skills through practical application of theoretical concepts.

Uploaded by

chetantricker98
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)
5 views2 pages

C Lab Practical Question Printout

The document outlines a series of programming exercises covering basic concepts such as variable types, arithmetic operations, control structures, loops, arrays, strings, functions, recursion, structures, unions, dynamic memory allocation, and file handling. Each section includes specific tasks for writing programs, such as calculating gross salary, finding the greatest of three numbers, and performing operations on arrays and strings. The exercises are designed to enhance programming skills through practical application of theoretical concepts.

Uploaded by

chetantricker98
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/ 2

Q1. First Basic Program-printing a Single or multiple Statement(s).

-Variable types and type conversions

Q1. Write a program to add two numbers.

2. WAP to perform simple arithmetic operations by calculating Gross Salary


of an employee (Taking basic salary from user, HRA=10% of basic, DA=3% of
basic and TA=2.5% of basic, where Gross salary=Basic salary+ HRA+ DA +TA)

Q3. Given the values of three variable entered by user, write a program to
calculate average of 3 numbers.
-
Q4. Write a program to SWAP two numbers.

Q5. Write a program to convert one data type to another by Type casting.

-Branching and logical expressions: Use of If, if- else, Else if, nested ifstatements and
operators with them andswitch case statement

Q1. WAP to find greatest of three numbers using nested if/else if


statements only.
Q2. WAP to assign Grade based on following:Marks is equal or greater than 90 – Grade
A, Marks equal or more than 80 and less than 90 –Grade B, Marks equal or more than
70 and less than 80 –Grade C, Marks equal or more than 60 and less than 70 –Grade D
and Marks less than 60 –Grade E(using if else if ladder and using logical AND or logical
OR operators).

Q3. WAP to design a simple calculator using switchcase statements

-Loops: do, while and for loops: Use of while loop, do while, and for loop:their Syntax

Q1. WAP to print table of any number using for loop.

Q2. WAP to print


Arrays and Strings the factorial of given number using for and while loop.

Q3. WAP to find whether the given number is prime or not using while
loop.
5-Arrays and Strings

Q1. WAP to insert 5 elements in 1D array, print, modify and traverse the array.

Q2. WAP to add two matrices

Q3. WAP to perform and display various string functions (strlen, strcat,
strlwr, strupr)

Q4. Write a program to check whether given string is a palindrome (strcpy,


strcmp, strrev)

6-Functions and Recursion

Q1. WAP to add two numbers using user defined function with return type
and arguments concept.

Q2.WAP to print factorial of a number using recursion.

Q3.WAP to print fibonacci series till nth term number using recursion.

7-Structure and Union

1.WAP to show use of structure.


2.WAP to show use of union.
3.WAP to show use of array of structures.

8-Dynamic Memory Allocation and File Handling

1.WAP to show use of malloc, calloc, realloc and free.

2.WAP to create, read and write to and from simple text files.

You might also like