0% found this document useful (0 votes)
9 views3 pages

C Questions Upto String

The document outlines a series of programming tasks categorized into different sections such as basic arithmetic operations, conditional statements, loops, arrays, and string functions. Each section includes specific programming assignments that require the implementation of various concepts in C programming. The tasks range from simple input/output operations to more complex algorithms involving arrays and string manipulations.

Uploaded by

Nathan Prajapati
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

C Questions Upto String

The document outlines a series of programming tasks categorized into different sections such as basic arithmetic operations, conditional statements, loops, arrays, and string functions. Each section includes specific programming assignments that require the implementation of various concepts in C programming. The tasks range from simple input/output operations to more complex algorithms involving arrays and string manipulations.

Uploaded by

Nathan Prajapati
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Sequence:

1. WAP to enter any two values and display the sum.


2. WAP to enter the principle, rate and time and display simple interest.
3. WAP to enter the length and breadth of rectangle and find the Area and perimeter of rectangle.
4. WAP to enter the length in meter and display in kilometer.
5. WAP to enter the marks of five subjects and display the total and percentage.
6. WAP to enter the radius of a circle and display the area and circumference of circle.
7. WAP to enter the temperature in F and display in degree c.
8. WAP to input length and breadth of a rectangular pond and find its area and perimeter.
9. WAP to input 5 integer numbers and display its sum.
10. WAP to enter name, age and salary and display it.

If else:
1. Write a program to find out whether entered number is positive or negative number.
2. Write a program to find greatest number among two numbers.
3. Write a program that input cost price (CP) and selling price (SP) and determines whether there is
gain or loss.
4. Write a program to input a mark in a subject of a student and check if the student is pass or not
(pass marks = 40).
5. WAP to input a number and check if it is even or odd.

If else if statement:
1. Write a program to find greatest number among four numbers.
2. What is control statement? Write a program which selects and prints largest among 3 numbers
using “if-else” statement with flow charts.
3. Write a program to find the commission amount on the basis of sales amount as per the
following condition.
Sales Amount (Rs.) Commission
0-1000 5%
1001 - 2000 10%
>2000 12%

Switch case statement


1. Define control structure. Write a program to find the sum, difference and greater of two integer
number using switch case statement.
2. Write a program which finds the sum, difference and product of 2 numbers using switch case
statement.
OR
Write a menu based program to find the sum, difference and product of any two numbers.
3. Write a program to display the name of day on the basis of entered number 1 to 7. For example,
1 for Sunday.
4. Write a menu driven C program to calculate area or perimeter of a rectangle using choice as A
for Area and P for Perimeter.
For loop:
1. Write a program to input an integer number and checks whether it is prime or not.
2. What are different types of loop in C? Write a program to print multiplication table of 1 to 10.
3. Write a program to display first ten even numbers.
4. Write a program to find the factorial of a given number.
5. Write a program to display first 10 even numbers using loop.
6. Write a program to display the multiplication table of nth terms of given number.
7. Write a program to print first 10th terms of the following series using for loop 1 5 9 13 …..
8. WAP to print Fibonacci series i.e. 0 1 1 2 3 5 8 ……. up to 10th term.
9. Write a program to display all prime numbers from 1 to 100.
10. Write an algorithm and a C program to input a number and reverse it.
11. WAP to check whether the given number is palindrome or not. Eg: 121
12. Write a program to display the following

1 *
1 2 * *
1 2 3 * * *
1 2 3 4 * * * *
1 2 3 4 5 * * * * *

* * * * * 1 2 3 4 5
* * * * 1 2 3 4
* * * 1 2 3
* * 1 2
* 1

13. What are different types of loop in C?


14. What is ‘while’ loop statement?
15. What is nested loop?
16. Differentiate between for loop and while loop.
17. Differentiate between while loop and do-while loop.

Array
1. Define array. Write a program to input any 10 numbers in an array and display it. Find the
biggest among the input numbers.
2. Write a program to enter 10 integer numbers into an array and display in ascending order.
3. Write a program to input 10 integer numbers into an array and display the sum of the numbers.
4. Write a program to read five positive number using array and find out the smallest among them.
5. Write a program which asks n th terms of numbers and sort them in ascending order.
6. What is an array? Write a program to enter 20 integer numbers into an array and display the
greatest number entered.
7. Write a program which reads name of 100 students and sort them in alphabetical order.
8. Write a program which asks the user to input ‘n’ terms of number and find out the greatest and
smallest number among those numbers.
9. Write a program which reads salary of 25 employees and count the number of employees who
are getting salary between 30,000 to 40,000.
10. WAP to enter elements into 4x4 matrix and find the sum of the elements of matrix.
11. WAP which finds multiplication table of two matrices (3x3).

String Function
1. What is string?
2. What are the string function in C?
3. Describe any five string handling functions with examples.
4. Describe the ‘strcat’, ‘strcpy’, ‘strcmp’, strlen’ and ‘strrev’ string functions with examples.
5. Describe the string manipulation function in C? Explain strcpy and strcmp with example.
6. Write a program to compare any two strings by using string function in C.

You might also like