GE6263 May 14
GE6263 May 14
APRIL/MAY-2014
Common to: B.E. EEE./B.E E&I /B.E ICE./B.E Marine Engineering
R-2013
02 SEMESTER
GE6263 : Computer Programming Laboratory
3. Write a C program to find the row minimum and maximum of a matrix with dynamic memory
allocation
2. Write a shell program to find the minimum value among three values
3. Write a C program to find the column minimum and maximum of a matrix with dynamic
memory allocation
3. Write a C program to find the sum of two matrices using dynamic memory allocation
1
1. Write and execute the following commands
a) to display the last two digits of the year
b) to display month name
c) to display all the users who have logged into the system with column header
d) to execute more than one command at a single execution
e) to display the first two lines of content in a file
3. Write a C program to combine two arrays in ascending order using dynamic memory allocation
3. Write a C program to combine two arrays without duplicates using dynamic memory allocation
3. Write a C program to add the content of two equal size array and store it into another array
using dynamic memory allocation
3. Write a C program to print the common values of two arrays with dynamic memory allocation
2
1. Write and execute the following commands
a) to display a line of text
b) to change the owner of a file
c) to display the first character of each line from a file
d) to copy one file to another file
e) to create an empty file
3. Write a C program to find the difference between two matrices with dynamic memory
allocation
3. Write a C program to multiply two rectangular matrices of any order with dynamic memory
allocation
3. Write a C program to copy the content of one array to the other in reverse order with dynamic
memory allocation
3. Write a C program to search an element from a list of values with dynamic memory allocation
3
1. Write and execute the following commands
a) to combine two files
b) to move the content of one file to another file
c) to list out the hidden files from a directory
d) to store the output of ls command to disk file
e) to list out the files whose names not begin with a to g
2. Write a shell program to count the number of even digit values from a value
3. Write a C program to print the distinct (non-duplicate) values from two arrays
2. Write a shell program to print number of positive, negative and zero values using case
statement
3. Write a C program to create a file with integer values. Open the file and read the content to
find the sum of all values in the file
3. Write a C program to create a file with integer values and open the file to read the content to
find the number of values in a file
4
1. Write and execute the following commands
a) to displays the 10 newest files in the current directory
b) to displays a list of directories and how much space they consume, sorted from the largest
to the smallest
c) to displays the total number of files in the current working directory and all of its
subdirectories
d) to list out the process running in the background
e) to kill the background process
2. Write a shell program to find the largest value from a set of values
2. Write a Shell program to find the Greeting based on system time using nested if statement
3. Write a C program to create a file with integer values and open the file in read mode to read the
content of the file then sort the content of the file in ascending order
3. Write a C program to create a file with integer values and open the file in read mode to read the
content of the file then sort the content of the file in descending order
5
1. Write and execute the following commands
a) to create a directory.
b) to display all the files and directories in the current directory
c) to display the time in HH:MM:SS format
d) to sorts contents of the file in the alphabetical order
e) to count the number of words, characters and lines in a file.
3. Write a C program to store a set of integer values. Open the file in read mode and count the
number of single, two and three digit values in a file
2. Write a shell program to find the number of blank spaces in a line of text
3. Write a C program to store a set of integer values. Open the file in read mode and count the
number of even values in the file
3. Write a C program to create two files with a set of values. Merge the two file content to form a
single file
3. Write a C program to count the number of prime numbers in an array with dynamic memory
allocation
6
1. Write and execute the following commands
a) to create a file
b) to display the weekday in an abbreviated form.
c) to search and display a line for a given word or pattern in a given file.
d) to display the current working directory.
e) to sort the contents of file in alphabetical order
2. Write a shell program to generate Armstrong numbers between 100 and 5000
3. Write a C program print the numbers which are divisible by 3 and not divisible by 2 from
an array of values with dynamic memory allocation
3. Write a C program to find row sum and column sum of a square matrix with dynamic memory
allocation
Mark Allocation
Question -
Question - 2 Question - 3 Viva Total
1
Algo. Prog. Exec. Algo. Prog. Exec.
10 100
20 marks 5 15 10 5 25 10 marks marks
marks marks marks marks marks marks
7
ANNA UNIVERSITY: CHENNAI 600 025
B.E./B.Tech. DEGREE EXAMINATIONS, APRIL /MAY- 2014
Regulations - 2013
Second Semester
(Common to EEE, E&I, I&C, Marine Engg.)
GE6263 COMPUTER PROGRAMMING LABORATORY
1. a. Write and execute the following UNIX commands 20
i.To display the pathname with your terminal
ii.Lists all entries, including the hidden files.
iii.View the contents of the file named text1.txt
iv.Count the number of lines, words and characters in a file.
b. Write a Shell program to accept the input as r and find the area and circumference of a
scircle. 40
c. Write a C program to accept the 15 natural numbers and find its mean, 40
median,mode, standard deviation and variance.
i. Create a directory
ii. Create a file
iii. Rename the directory
iv. Rename the file
b. Write a Shell program to check the given number is Armstrong or not. 40
c. Write a C program to find the sum of n numbers using function. 40
*****************
ANNA UNIVERSITY: CHENNAI 600 025
B.E. / B.Tech. DEGREE EXAMIATIONS, APR / MAY 2014
Regulation 2013
Second Semester
(Common to: B.E-Electrical and Electronics Engg. / B.E-Electronics and Instrumentation Engg. /
B.E-Instrumentation and Control Engg. / B.E-Marine Engg.)
GE6263 Computer Programming Laboratory
Duration: 3 Hours Maximum Marks: 100
c) Write a shell program to find whether the given year is leap year or not.
c) Write a c program to find the sum of all the digits of a given multi-digit number using
function with arguments and no return values
3. a) Write and execute the following UNIX commands
(i) To view only the files in a directory
(ii) Display the working directory
(iii)Execute more than one command at a time.
(iv) Demonstrate the pipe command
(v) Count the number of words in the file
b) Write a shell program to find the biggest & smallest among the three given
numbers.
c) Write a c program to swap two numbers using function call by value method
b) Write a shell program to reverse the given number. (Ex. 35246 to 64253)
c) Write a c program to find the sum of all the digits of a given multi-digit number
using function with arguments and return values.
b) Write a shell script to find whether a given number is Armstrong or not. (NOTE: A
number is Armstrong if the sum of cubes of individual digits of a number is equal to t
the number itself)
c) Write a C program to find the product of two matrices of order (n X m) and (m Xp)
using dynamic memory allocation. Furnish output for two different input datasets
7. a) Write and execute the following UNIX commands
(i) Create a file
(ii) Print the specified number of lines of a file from start to end of the file.
(iii) Display the file content with line number
(iv) Update the file content with I/O redirection
(v) Rename the file
b) Write a shell program to find whether the given number is odd or even.
c) Write a c program to copy the contents of one text file into another text file.
c) Write a c program to find the smallest and greatest among the given n number using
dynamic memory allocation.
b) Write a shell program to find whether the given number is prime number or not.
c) Write a C program to find the greatest common divisor (GCD) and least common
multiple (LCM) of two integers.
b) Write a shell program to find whether the given year is leap year or not.
(i) Print today date and the calendar of the current month using single
command
(ii)Create a sub-directory with your name in the Home directory
(iii) Create a file in the Home directory
(iv) Copy the file to the sub directory
(v) Using pipe command sort the files in alphabetical order and store it in
file1.dat
b) Write a shell program to execute any five UNIX command using case statements
*
***
*****
*******
*********
*******
*****
***
*
b) Write a shell program to find the smallest and largest number from a set of
numbers
b) Write a shell program to find second largest number from a set of numbers.
c) Write a C program to create a file, which contains employee id, name, age etc
and display the content
c) Write a C program to create a file, which contains register number, name, age
etc. and display the content of the file.
20. a) Write and execute the following UNIX commands
(i) Count the specific number of lines from a file start from the
beginning of the file
(ii) To destroy a specific file from a user directory
(iii) Send a greeting message to other user
(iv) Execute a shell program
(v) To display currents time
b) Write a Shell program to generate Fibonacci series
c) Write a C program to create a file, which contains register number, name,
age etc. and display the content of the file.
MARK ALLOTMENT
c) C Programming** - 40 marks
Viva-voce - 10 marks
Algorithm - 5 marks
TOTAL - 30 MARKS
Algorithm - 10 marks
Program - 20 marks
Execution - 10 marks
TOTAL - 40 MARKS