Computer Programming Lab Exercises
NANNAPANENI VENKATA RAO COLLEGE OF ENGINEERING & TECHNOLOGY
NVR NAGAR, TENALI.
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
COMPUTER PROGRAMMING LAB
Exercise - 1: Basic
a) What is an OS Command, Familiarization of Editors - vi, Emacs
b) Using commands like mkdir, ls, cp, mv, cat, pwd, and man
c) C Program to Perform Adding, Subtraction, Multiplication and Division of two numbers
From Command line
Exercise - 2: Control Flow - I
a) Write a C Program to Find Whether the Given Year is a Leap Year or not.
b) Write a C Program to Add Digits & Multiplication of a number
Exercise - 3: Control Flow - II
a) Write a C Program to Find Whether the Given Number is
i) Prime Number
ii) Armstrong Number
b) Write a C program to print Floyd Triangle
c) Write a C Program to print Pascal Triangle
Exercise - 4: Functions
a) Write a C Program demonstrating parameter passing in Functions and returning values.
b) Write a C Program illustrating Fibonacci, Factorial with Recursion without Recursion
Exercise - 5: Control Flow - III
a) Write a C Program to make a simple Calculator to Add, Subtract, Multiply or Divide Using
Switch…case
b) Write a C Program to convert decimal to binary and hex (using switch call function the
function)
Exercise - 6: Arrays
a) Demonstration of arrays
b) Search-Linear
c) Operations on Matrix.
Exercise - 7: Structures
a) Write a C Program to Store Information of a Movie Using Structure
b) Write a C Program to Store Information Using Structures with Dynamically Memory
Allocation
c) Write a C Program to Add Two Complex Numbers by Passing Structure to a Function
Exercise - 8: Arrays and Pointers
a) Write a C Program to Access Elements of an Array Using Pointer
b) Write a C Program to find the sum of numbers with arrays and pointers.
Exercise - 9: Strings
a) Implementation of string manipulation operations with library function.
i) Copy
ii) Concatenate
iii) Length
iv) Compare
b) Implementation of string manipulation operations without library function.
i) Copy
ii) Concatenate
iii) Length
iv) Compare
Exercise -10: Files
a) Write a C programming code to open a file and to print it contents on screen.
b) Write a C program to copy files
Exercise - 11: Files Continued
a) Write a C program merges two files and stores their contents in another file.
b) Write a C program to delete a file.