[go: up one dir, main page]

0% found this document useful (0 votes)
19 views4 pages

Document 2

Uploaded by

Anish Gelal
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)
19 views4 pages

Document 2

Uploaded by

Anish Gelal
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/ 4

1.

Input Output Programs

WAP to print "Hello World".


WAP to find the sum of two numbers.
WAP to find the simple interest.
WAP to find the area of a circle.
WAP to convert Celsius to Fahrenheit.
WAP to find the total and percentage of five subjects.
WAP to print the ASCII value of a character entered by the user.
WAP to calculate the perimeter of a rectangle.
WAP to take input from the user and display it in reverse order.

2. Different Operators

WAP to check whether a number is divisible by 5 and 8 or not.


WAP to check if a character is a vowel or a consonant.
WAP to check if a number is even or odd.
WAP to find the largest number among three numbers.
WAP to find the smallest among three numbers using nested if-else.
WAP to calculate the power of a number using the pow() function.
WAP to calculate the remainder of two numbers using the modulus operator.
WAP to demonstrate the use of increment (++) and decrement (--) operators.

3. If-Else and Switch Case

WAP to check whether a number is negative or positive.


WAP to display the day of the week using a switch case.
WAP to calculate using a switch case.
WAP to calculate the grade of a student based on marks using if-else.
WAP to check the eligibility to vote based on age using if-else.
WAP to find the type of triangle (e.g., scalene, isosceles, or equilateral) using if-
else.
WAP to perform a basic calculator using a switch case.
4. Loop

WAP to display "Hello World" 10 times using a do-while loop.


WAP to find the sum of N numbers using a for loop.
WAP to reverse a number using a while loop.
WAP to display the multiplication table of a given number.
WAP to find the factorial of a given number.
WAP to generate the Fibonacci series.
WAP to check whether an input number is prime or not.
WAP to find if a number is an Armstrong number or not.
WAP to check if a number is a palindrome or not.
To display patterns through nested loops:
Example 1:
Copy code
11111
22222
33333
44444
55555

Example 2:
Copy code
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5

5. Function

WAP to find the sum of two numbers using passing arguments and returning values.
WAP to pass arguments and obtain the value of the sum using passing arguments
but not returning values.
WAP to find the sum of two numbers using passing no arguments and returning
values.
WAP to find the sum of two numbers using no arguments and no return values.
WAP to find the factorial using a recursive function.
WAP to generate a Fibonacci sequence using a recursive function.

6. Array

To store the value input by the user and display them using an array.
To find the smallest element from the array.
To search for a particular element in an array.
Display 10 numbers using an array.
WAP to sort an array in ascending order.
WAP to sort an array in descending order.
To store data in a two-dimensional array and display it.
To find the sum of two matrices.
Perform matrix multiplication.

7. Pointer

WAP to demonstrate pointer addition.


WAP to swap two numbers using pointers.
WAP to find the length of a string using pointers.
WAP to reverse a string using pointers.
WAP to demonstrate the malloc function.
WAP to demonstrate the calloc function.

8. String

Display your name.


Use of strlen function.
Use of strrev function.
Copy a string from source to destination using strcpy function.
Concatenate strings using strcat function.
Compare strings using strcmp function.
Given a string, check if it is a palindrome or not.
Sort names in ascending order.
9. Structure

WAP to define a structure to store the record of an employee with id, name, sex,
and salary.
Read a record of an employee from the user and display the record.
WAP to read the data of a book including book id, book name, book price, and
number of pages using a structure and display them.
WAP to create a structure for a student with fields roll number, name, and marks
and display the data.
WAP to create a structure for a point with x and y coordinates and calculate the
distance between two points.
WAP using an array of structures.
WAP to demonstrate the use of a union.

10. File

WAP to ask the name and age of a person and store it in a file named record.dat.
WAP to read from a file and display its contents on the console.
WAP to count the number of characters, words, and lines in a file.
WAP to write the squares of numbers from 1 to 10 into a file.

You might also like