0% found this document useful (0 votes)
16 views

lab external model question

The document outlines a series of programming exercises in C, covering a variety of topics such as operators, data type conversion, interest calculations, class awards based on percentage, multiplication tables, prime number checks, Fibonacci sequences, file operations, and sorting algorithms. Each exercise specifies a particular task to be accomplished, often requiring user input and the use of specific programming constructs like loops, conditionals, and functions. The exercises range from basic operations to more complex data handling and algorithm implementation.

Uploaded by

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

lab external model question

The document outlines a series of programming exercises in C, covering a variety of topics such as operators, data type conversion, interest calculations, class awards based on percentage, multiplication tables, prime number checks, Fibonacci sequences, file operations, and sorting algorithms. Each exercise specifies a particular task to be accomplished, often requiring user input and the use of specific programming constructs like loops, conditionals, and functions. The exercises range from basic operations to more complex data handling and algorithm implementation.

Uploaded by

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

Practice sessions:

1.Write a simple program that prints the results of all the operators available in C (including pre/
post increment , bitwise and/or/not , etc.). Read required operand values from standard input.

2. Write a simple program that converts one given data type to another using auto conversion and
casting. Take the values from standard input.

3.Write a program for finding the max and min from the three numbers.

4.Write the program for the simple, compound interest.

5.Write a program that declares Class awarded for a given percentage of marks, where mark = 70% =
Distinction. Read percentage from standard input.

6.Write a program that prints a multiplication table for a given number and the number of rows in
the table. For example, for a number 5 and rows = 3, the output should be:5 x 1 = 5 f. 5 x 2 = 10

5 x 3 = 15

8.Write a C program, which takes two integer operands and one operator from the user, performs
the operation and then prints the result. (Consider the operators +,-,*, /, % and use Switch
Statement)

9.Write a program that finds if a given number is a prime number

10. Write a C program to find the sum of individual digits of a positive integer and test given number
is palindrome.

11. A Fibonacci sequence is defined as follows: the first and second terms in the sequence are 0 and
Subsequent terms are found by adding the preceding two terms in the sequence. Write a C program
to generate the first n terms of the sequence.

12. Write a C program to generate all the prime numbers between 1 and n, where n is a value
supplied by the user.

13.Write a C program to find the roots of a Quadratic equation.

14Write a C program to find the minimum, maximum and average in an array of integers.

16.Addition of Two Matrices e

.17Multiplication of Two Matrices

18.To find the factorial of a given integer.

19.Write a program for reading elements using a pointer into an array and display the values using
the array.

20Write a program for display values reverse order from an array using a pointer.
21 Write a program through a pointer variable to sum of n elements from an array.

22Write a C program to display the contents of a file to standard output device.

23 Write a C program which copies one file to another, replacing all lowercase characters with their
uppercase equivalents.

24Write a C program to merge two files into a third file (i.e., the contents of the first file followed by
those of the second are put in the third file).

25 To delete n Characters from a given position in a given string.

26 Write a C program to determine if the given string is a palindrome or not (Spelled same in both
directions with or without a meaning like madam, civic, noon, abcba, etc.)

27Write a C program that uses non recursive function to search for a Key value in a given

list of integers using linear search method.

28Write a C program that uses non recursive function to search for a Key value in a given

sorted list of integers using binary search method.

29Write a C program that implements the Bubble sort method to sort a given list of

integers in ascending order.

30Write a C program that sorts the given array of integers using selection sort in descending order.
31Write a C program that sorts the given array of integers using insertion sort in ascending order

You might also like