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

CPU Practicals: I/O Fuctions

This document provides a list of practical programming exercises covering fundamental concepts in C programming including I/O functions, control structures, arrays, strings, functions, pointers, structures, and file management. Some key areas covered include writing programs to perform basic math operations and comparisons, use conditional and looping constructs, manipulate arrays and strings, define reusable functions, use pointers, structures to organize data, and read/write files. The exercises are intended to help learn and practice essential C programming skills.

Uploaded by

parthiv22191
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)
111 views

CPU Practicals: I/O Fuctions

This document provides a list of practical programming exercises covering fundamental concepts in C programming including I/O functions, control structures, arrays, strings, functions, pointers, structures, and file management. Some key areas covered include writing programs to perform basic math operations and comparisons, use conditional and looping constructs, manipulate arrays and strings, define reusable functions, use pointers, structures to organize data, and read/write files. The exercises are intended to help learn and practice essential C programming skills.

Uploaded by

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

CPU Practicals

I/O Fuctions

2) Control
Structures

1)
2)
3)
4)
5)
6)
7)

Write a program print Hello World on screen.


Write a program to find area of a Circle of radius r.
Write a program to evaluate area of square.
Write a program to convert fahrenhit temperature into celsius
Write a program to perform arithmetic operations.
Write a program to swap given two numbers.
Write a program to find greatest number in given two numbers using
conditional operator.
8) Write a program to find maximum and minimum of two numbers using
ternary & operator.
9) Write a program to multiply and divide the given number by 4 using
bitwise operators << and >>.
10) Write a program to exchange two variables
(a) Using third variable
(b) Without using third variable
11) Write a program to convert given lowercase letter to uppercase letter.
1) Write a program to find largest number using if...else statement
2) Write a program to check given num is odd or even.
3) Write a program to find largest number using nested if...else statement
4) Write a program to check the category of given character. Digit,
Uppercase, lowercase or other symbol. Using multiple ifelse.
5) Write a program to check given num is Armstrong or not.

switch
statement

(1)Write a program to create a simple calculator for addition, subtraction,


multiplication and division.
(2)Write a program to print number of days in a given month. The program
requires month number as an input and then display the days in that month.
(3)Write a program to check the entered character is vowel or not.

while loop

(1)Write a program to print sum of first n integer numbers using while loop.
(2)Write a program to reverse a given integer number. And also check for
palindrome
(3)Write a program to check given number is Armstrong number or not.
(4)Write a program to print first N Fibonacci numbers
(5)Write a program to find the factorial of a given number.
(6)Write a program to find total of all even integers.

dowhile
LOOP

For loop

Nesting of loop

(1)Write a program to sum the individual digits of a given positive number


using dowhile loop.
(2)Write a program to print all integers between string and ending range
divisible by 11.
(3)Write a program to compute the sum of following series. 1 1/2 + 1/3 -
+1/n.
(4)Write a program to reverse a given integer number and also check for
palindrome.
(5) Write a program to find sum of all odd integers
(1) Write a program to check given number is prime number or not.
(2) Write a program to print a number and its square, cube for numbers 1 to 10.
(3) Write a program to find factorial of a given number using for loop.
(4) Write a program to calculate sum of following series.
(5) 1/x 2/x2 + 3/x3 - 4/x4 .
(1)Write a program to print following pattern.
1
23
456
7 8 9 10
*
**
***
****
*****
1
12
123
1234
12345

A
BB
CCC
DDDD
EEEEE
*****
****
***
**

*
*
***
*****
*******
*********
1
232
34543
4567654
567898765

1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
Array

(1) Write a program to perform linear search using array.


(2) Write a program for addition of two matrices using multidimensional
arrays.
(3) Write a program to get n numbers and find out sum and average of
numbers using array
(4) Write a program to insert a number at a specified array index position.
(5) Write a program using an array to find largest and smallest number from
given n numbers.
(6) Write a program to find number of odd and even numbers from given n
numbers.
(7) Write a program which declares array of 10 integers, enter the data and
sum all the elements which are even. Also find the maximum number
from the even numbers.
(8) Write a program to read 5*5 matrix and find maximum number with its
row and column index.
(9) Write a program to read n*n matrix. Display original matrix as well as its
transpose matrix.

Sting

Function

Pointer

Structure

File
Management

(1) Write a program to find length of a given string.


(2) Write a program to count number of words in a string and also print each
word on separate line.
(3) Write a program to convert given string into upper case and lower case.
(4) Write a program that takes a string and reverses it.
(5) Write a program to extract a string
(6) Write a program that takes a string and display each character in one line
with its ASCII value.
(1) Write a program to Add Two Numbers Using Function .
(2) Write a program to find largest of three numbers using function. Ask the
user to continue or not.
(3) Write a program using function which receives number as argument and
return sum of digits of that number.
(4) Write a program to check leap year using function.
(5) Write a program to exchange the value of two variables using function.
(6)write a program to find factorial of a given number using recursion.
(7) Write a program to sum major diagonal elements of square matrix.
(1)Write a program to access the data using pointer variables.
(2)Write a program to print the element of array using pointers.
(3)Write a program to print array elements in reverse using pointer.
(4)Write a program to manipulate string using pointers.
(1) Write a programs to display student information by initializing structures.
(2) Write a program to calculate and print total salary of employees using
structure.
(3) Write a program to store information about books and display those books
which cost less than rs.300.
(4) Write a program using nested structure to accept and print details of an
employee.
(5) Write a program to input and print details of students using array of
pointers to structure.
(6) Write a program using function and structure to accept item information
such as name, quantity, unit, price and cost. Then print the details of each
item.
(7) Write a program to print the elements of a structure using pointers
(1) Write a program to Find the Number of Lines in a Text File.
(2) Write a program to display text of a given file.
(3) Write a program to copy one fiel a.txt to other file b.txt.
(4) Write a program to write integer data into file and read it from file
(5) Write a program to create a file of five student record, rollno, name,branch
name.
(6) Write a program to copy one file into other by using command line
argument

You might also like