Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
45 views

Python Lab Manual

Uploaded by

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

Python Lab Manual

Uploaded by

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

DEPT OF COMPUTER ENGINEERING

4052540- Python Programming Practical

LAB OBSERVATION

Name: -----------------------------------------------------------------

Reg-No: -----------------------------------------------------------------

Year & Sem: -----------------------------------------------------------------

1
INDEX
S.No List of Experiments Page Marks Signature
No Awarded
PART - A
1 (i) Write a Python program to compute GCD of two numbers

Write a Python Program to print prime numbers in the given


1 (ii)
range.
Write a Python Program to check the given year is leap year or
2 (i)
not.
Write a Python Program to print Armstrong numbers between
2 (ii)
given range.
Write a Python Program to do basic trim and slice operations on
3 (i)
String.
Write a Python Program to accept line of text and find the
3 (ii)
number ofcharacters, vowels and blank spaces on it
Write a Python Program using function to display all such
4 (i) numbers which is divisible by 3 but are not multiple of 5 in a given
range.
Write a Python Program using recursion to print ‘n’ terms in
4 (ii)
Fibonacci series.
5 Write a Python Program to add ‘ing’ at the end of a given string if
the string has 3 or more characters . If the given string is already
ends with ‘ing’ then add ‘ly’ instead. If the string has` less than 3
characters, leave it unchanged.
6 Write a Python program to find minimum and maximum of a list
of numbers
7 Write a Python program to display a list in reverse order.

8 Write a Python Program to print the first half values of tuple in


one line and last half values in next line.
PART – B
9 Write a Python Program to take a list of words and return the
length of the longest one using string.
10 Write a Python Program to find an element in a given set of
elements using Linear Search
11 Write a Python Program to sort a set of elements using Selection
sort.
12 Write a Python Program to multiply two matrices.

13 Write a Python program to demonstrate different operations on


Tuple.
14 Write a Python Program to demonstrate to use Dictionary and
related functions.
15 Write a Python Program to copy file contents from one file to
another and display number of words copied.

2
PART-A

Date:
Ex.No :1(i)

AIM To Write a Python program to compute GCD of two numbers

Procedure :

1. Let a, b be the two numbers

2. a mod b = R

3. Let t = b and b = R a=t

4. Repeat Steps 2 and 3 until a mod b is greater than 0

5. GCD = a

6. Finish

PROGRAM :

a=int(input("Enter the value of a:"))


b=int(input("Enter the value of b:"))
a1=a
bl=b
while (b!=0):
t=b
b=a%b
a=t
print("The GCD of {} and {} is {}" .format(a1,bl,a))

OUTPUT

GCD of 98 and 56 is 14

RESULT
Thus the above program was executed successfully and output was verified

3
Date:
Ex.No :1(ii)

AIM To Write a Python Program to print prime numbers in the given range.

Procedure :

1. Take the range of numbers between which you have to find the prime numbers as input.

2. Check for prime numbers only on the odd numbers between the range.

3. Also check if the odd numbers are divisible by any of the natural numbers starting from 2.

4. Print the prime numbers

5. Finish.

PROGRAM :

n1=int(input("Enter the first number in


the range:"))
n2=int(input("Enter the second number in
the range:"))

#print("Prime numbers between", lower,


"and", upper, "are:")

for num in range(n1, n2 + 1):


# all prime numbers are greater than 1
if num > 1:
for i in range(2, num):
if (num % i) == 0:
break
else:
print(num)

4
OUTPUT

Enter the first number in the range:1


Enter the second number in the range:100
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
73
79
83
89
97

RESULT

Thus the above program was executed successfully and output was verified

5
Date:
Ex.No :2(i)

AIM To Write a Python Program to check the given year is leap year or not.

Procedure :

1. Take an integer variable

2. Assign values to the variable

3. Check whether a year is divisible by four but not with hundred and print leap year.

4. Check if a year is divisible by four hundred and print leap year

5. Otherwise, print not leap year

PROGRAM :

year=int(input("Enter a year: "))


if ((year%4== 0 and year%100!=0) or
year%400==0):
print("The given year {} is
leap". format(year))
else:
print("The given year {} is not
leap". format (year))

OUTPUT

Enter a year: 2004


The given year 2004 is leap

Enter a year: 2022


The given year 2022 is not leap

RESULT

Thus the above program was executed successfully and output was verified

6
7
Date:
Ex.No :2(ii)

AIM To Write a Python Program to print Armstrong numbers between given range.

Procedure :

1. Input the start and end values.


2. Repeat from i = start_value to end_value.
3. Repeat until (temp != 0)
4. remainder = temp % 10
5. result = result + pow(remainder,n)
6. temp = temp/10
7. if (result == number)
8. Print the number
9. Repeat steps from 2 to 8 until the end_value is encountered.

PROGRAM :

n1=int(input("Enter first number in the range:"))


n2=int(input("Enter second number in the range:"))

for num in range(n1, n2 + 1):

# order of number
order = len(str(num))

# initialize sum
sum = 0

temp = num
while temp > 0:
digit = temp % 10
sum += digit ** order
temp //= 10

if num == sum:
print(num)

8
OUTPUT

Enter first number in the range:2


Enter second number in the range:200
2
3
4
5
6
7
8
9
153

RESULT

Thus the above program was executed successfully and output was verified

9
Date:
Ex.No :3(i)

AIM To Write a Python Program to do basic trim and slice operations on String.

Procedure :

Python slicing can be done in two ways:

 Using a slice() method


 Using array slicing [ : : ] method

Method 1: Using slice() method

The slice() constructor creates a slice object representing the set of indices specified by
range(start, stop, step).
Syntax:
slice(stop)
slice(start, stop, step)
Parameters: start: Starting index where the slicing of object starts. stop: Ending index where the
slicing of object stops. step: It is an optional argument that determines the increment between each
index for slicing. Return Type: Returns a sliced object containing elements in the given range only.

Method 2: Using List/array slicing [ : : ] method

In Python, indexing syntax can be used as a substitute for the slice object. This is an easy and
convenient way to slice a string using list slicing and Array slicing both syntax-wise and execution-
wise. A start, end, and step have the same mechanism as the slice() constructor.
Below we will see string slicing in Python with example.
Syntax
arr[start:stop] # items start through stop-1
arr[start:] # items start through the rest of the
array
arr[:stop] # items from the beginning through stop-
1
arr[:] # a copy of the whole array
arr[start:stop:step] # start through not past stop, by step

Python provides three methods that can be used to trim whitespaces from the string object.

 strip(): returns a new string after removing any leading and trailing whitespaces including tabs (\t).
 rstrip(): returns a new string with trailing whitespace removed. It’s easier to remember as removing white
spaces from “right” side of the string.

10
 lstrip(): returns a new string with leading whitespace removed, or removing whitespaces from the “left”
side of the string.

PROGRAM :

String = 'ASTRING'

# Using slice constructor


s1 = slice(3)
s2 = slice(1, 5, 2)
s3 = slice(-1, -12, -2)

print(& quot
String slicing & quot
)
print(String[s1])
print(String[s2])
print(String[s3])

# Using array clice

s="Welcome to Python"

print("The sliced string from index 2 to 8 is: ",s[2:9])


print("The sliced string from index 0 to 5 is: ",s[:6])
print("The sliced string from index 5 to last is: ",s[5:])

s1=" Good Morning "

print("The string after removing leading and trailing


white spaces is:", s1.strip())
print("The string after removing leading white spaces
is:",s1.lstrip())
print("The string after removing trailing white spaces
is:",s1.rstrip())

OUTPUT

String slicing
AST
SR
GITA
The sliced string from index 2 to 8 is: lcome t
The sliced string from index 0 to 5 is: Welcom
The sliced string from index 5 to last is: me to Python
The string after removing leading and trailing white spaces is: Good Morning
The string after removing leading white spaces is: Good Morning
The string after removing trailing white spaces is: Good Morning

RESULT
11
Thus the above program was executed successfully and output was verified

12
Date:
Ex.No :3(ii)

AIM To Write a Python Program to accept line of text and find the number ofcharacters,
vowels and blank spaces on it

Procedure :

1. Then make three variables, vowel, line , spaces and character to count the number of vowels,
lines, and characters respectively.
2. Make a list of vowels so that we can check whether the character is a vowel or not.
3. When the count hits the ‘\n’ character we have to increase our line variable means a new line in
the file.
4. After that iterate over the characters of the file and count the vowels, lines, and characters.

PROGRAM :

s=input("Enter a string:")
vowels = 0
characters = 0
spaces = 0
s = s.lower()
vow="aeiou"
for i in s:
if i in vow:
vowels = vowels + 1
if (i> 'a'and i<='z'):
characters = characters+ 1
else:
spaces = spaces + 1

print("Vowels: ", vowels);


print("Characters:", characters);
print("White spaces:", spaces);

OUTPUT

Enter a string:KSR Polytechnic College


Vowels: 6
Characters: 21
White spaces: 2

RESULT

Thus the above program was executed successfully and output was verified

13
Date:
Ex.No :4(i)

AIM To Write a Python Program using function to display all such numbers which is
divisible by 3 but are not multiple of 5 in a given range.

Procedure :

1. Input Lower and upper limit number


2. Check divisible by by modulo operator to check remider is zero for 3 and not for 5
3. If reminder and zero print that number

PROGRAM :

n1=int(input("Enter the first number:"))


n2=int(input("Enter the second number: "))
print("The numbers which are divisible by 3 but not multiple of 5 are :")
for i in range(n1,n2+1):
if (i%3==0 and i%5!=0):
print(i)

OUTPUT

Enter the first number:1


Enter the second number: 30
The numbers which are divisible by 3 but not multiple of 5 are :
3
6
9
12
18
21
24
27
RESULT

Thus the above program was executed successfully and output was verified

14
Date:
Ex.No :4(ii)

AIM To Write a Python Program using recursion to print ‘n’ terms in Fibonacci series.

Procedure :

What is Fibonacci Series?

A Fibonacci series is a series in which next number is a sum of previous two numbers.

For example : 0, 1, 1, 2, 3, 5, 8 ……

In Fibonacci Series, first number starts with 0 and second is with 1 and then its grow like,

0+1=1

1+1=2

1+2=3

2 + 3 = 5 and

so on…

1. Here first of all we have declared one function named fib which will take integer as a input and
will return a next integer element.

2. In the above program I have taken 2 variables n and i of integer type.


3. Now our main logic will start from a “for loop”. This loop will be called n number of times, where
n is given as input.

4. And each time when loop condition will satisfy the value of i will pass as a parameter to fib ()
method as a input.

5. In the body of fib (int i) function we have nested if-else.


6. If input is 0 then it will return 0.
7. It input is 1 then it will return 1.
8. And if the value is greater then one then calculation will perform using fib (i-1) + fib (i-2).

15
PROGRAM :

# Python program to display the Fibonacci sequence

def fib(n):
if n <= 1:
return n
else:
return(fib(n-1) + fib(n-2))

nterms=int(input("Enter the value of n: "))

# check if the number of terms is valid


if nterms <= 0:
print("Plese enter a positive integer")
else:
print("Fibonacci sequence:")
for i in range(nterms):
print(fib(i))

OUTPUT

Enter the value of n: 10


Fibonacci sequence:
0
1
1
2
3
5
8
13
21
34

RESULT

Thus the above program was executed successfully and output was verified

16
Date:
Ex.No : 5

AIM To Write a Python Program to add ‘ing’ at the end of a given string if the string has 3
or more characters . If the given string is already ends with ‘ing’ then add ‘ly’ instead.
If the string has` less than 3 characters, leave it unchanged.

Procedure :

1. Get the input string


2. Check length of string and store in variable l
3. If length of string greater than three check last three character for ‘ing’
4. If last three character is ing replace ly else leave it
5. Print modified string

PROGRAM :

s=input("Enter a string: ")


sl=s

l=len(s)
if l>=3:
if s[-3:]=='ing':
s=s+'ly'
else:
s=s+'ing'
print("The given string is: ",sl)
print("The modified string is: ",s)

OUTPUT

Enter a string: homework


The given string is: homework
The modified string is: homeworking

RESULT

Thus the above program was executed successfully and output was verified

17
Date:
Ex.No : 6

AIM To Write a Python program to find minimum and maximum of a list of numbers

Procedure :
1. Get total number
2. Input all numbers one by one
3. Find minimum number
4. Find maximum number
5. Print minimum number in list
6. Print maximumnumber in list

PROGRAM :

L=[]
N=int(input("Enter the total number:"))
print("Enter the numbers one by one")
for i in range(N):
x=int(input())
L.append(x)
minl=min(L)
maxl=max(L)
posmin = L.index(minl)
posmax = L.index(maxl)
print("The minimum number among the given numbers is:",minl)
print("The position of the minimum number is:",posmin)
print("The maximum number among the given numbers is:",maxl)
print("The position of the maximum number is: ", posmax)

OUTPUT
Enter the total number:6
Enter the numbers one by one
6
87
3
987
1
8
The minimum number among the given numbers is: 1
The position of the minimum number is: 4
The maximum number among the given numbers is: 987
The position of the maximum number is: 3

RESULT

Thus the above program was executed successfully and output was verified

18
19
Date:
Ex.No : 7

AIM To Write a Python program to display a list in reverse order.

Procedure :

1. Start
2. Get total number of elements
3. Input all numbers one by one upto N elements
4. Display the list by reverse using reverse function
5. Finish

PROGRAM :

L=[]
N=int(input("Enter the total number of list elements: "))
print("Enter the elements one by one:")
for i in range(N):
x=int(input())
L.append(x)
print("The original list is: ",L)
print("The reversed list is: ",end="")
L.reverse()
print(L)

OUTPUT

Enter the total number of list elements: 5


Enter the elements one by one:
69
56
7
36
25
The original list is: [69, 56, 7, 36, 25]
The reversed list is: [25, 36, 7, 56, 69]

RESULT

Thus the above program was executed successfully and output was verified

20
Date:
Ex.No : 8

AIM To Write a Python Program to print the first half values of tuple in one line and last
half values in next line.

Procedure :

1. Start
2. Declare tp and assign a value to it
3. Print first half tule value with range 1 to half of tuble
4. Print second half tule value with range half of tuple to last element
5. End

PROGRAM :

tp=(3,4,5,6,7,19,70, "good", "bad",89.76)


l=len(t)
print("The given tuple is: ",t)
print("The First half tuple values are:", t[:l//2])
print("The Second half tuple values are: ",t[l//2:])

OUTPUT

The given tuple is: (3, 4, 5, 6, 7, 19, 70, 'good', 'bad', 89.76)

The First half tuple values are: (3, 4, 5, 6, 7)

The Second half tuple values are: (19, 70, 'good', 'bad', 89.76)

RESULT

Thus the above program was executed successfully and output was verified

21
Date:
Ex.No : 9

AIM To Write a Python Program to take a list of words and return the length of the longest
one using string.

Procedure :

1. Start
2. Get no of string N stored in list
3. Get string one by one upto N
4. The length of the list is assigned to a variable.
5. The list is iterated over, and every element’s length is checked to see if it is greater than
length of the first element of the list.
6. If so, this is assigned as the maximum length.
7. Print the longest word inlist
8. End

PROGRAM :

l=[]

n=int(input("Enter the number of words in the list: "))


print("Enter the words one by one")
for i in range(n):
w=input()
l.append(w)
x=l[0]
l1=len(x)
for i in l:
l2=len(i)
if l2>l1:
l1=l2
x=i
print("The longest word in the list {} is {}".format(l,x))

OUTPUT

Enter the number of words in the list: 3


Enter the words one by one
KSR
Polytechnic
college
The longest word in the list ['KSR', 'Polytechnic', 'college'] is Polytechnic

RESULT

Thus the above program was executed successfully and output was verified

22
Date:
Ex.No : 10

AIM To Write a Python Program to find an element in a given set of elements using Linear
Search

Procedure :

1. First, read the search element (Target element) in the array.


2. In the second step compare the search element with the first element in the array.
3. If both are matched, display "Target element is found" and terminate the Linear Search
function.
4. If both are not matched, compare the search element with the next element in the array.
5. In this step, repeat steps 3 and 4 until the search (Target) element is compared with the last
element of the array.
6. If the last element in the list does not match, the Linear Search Function will be
terminated, and the message "Element is not found" will be displayed.

PROGRAM :

n=int(input("Enter the number of data:"))


a=[]
for i in range(n):
x=int(input("Enter the next data:"))
a.append(x)
x=int(input("Enter the element to search"))
for i in range(n):
if a[i]==x:
print("The element {} is present in position {}".format(x,i))
break
if i==n-1:
print("Search Faild")

23
OUTPUT

Enter the number of data:3


Enter the next data:56
Enter the next data:25
Enter the next data:96
Enter the element to search5
Search Faild

Enter the number of data to sort:5


Enter the next data:36
Enter the next data:89
Enter the next data:45
Enter the next data:25
Enter the next data:888
Enter the element to search45
The element 45 is present in position 2

RESULT

Thus the above program was executed successfully and output was verified

24
Date:
Ex.No : 11

AIM To Write a Python Program to sort a set of elements using Selection sort.

Procedure :

1. Set MIN to location 0

2. Search the minimum element in the list

3. Swap with value at location MIN

4. Increment MIN to point to next element

5. Repeat until list is sorted

PROGRAM :

n=int(input("Enter the number of data to sort:"))


a=[]
for i in range(n):
x=int(input("Enter the next data:"))
a.append(x)
print("The original list is:",a)
for i in range(n):
min=a[i]
t=i
for j in range(i+1,n):
if min > a[j]:
min=a[j]
t=j
a[t]=a[i]
a[i]=min
print("The sorted list is:",a)

25
OUTPUT

Enter the number of data to sort:5


Enter the next data:69
The original list is: [69]
Enter the next data:56
The original list is: [69, 56]
Enter the next data:48
The original list is: [69, 56, 48]
Enter the next data:1
The original list is: [69, 56, 48, 1]
Enter the next data:96
The original list is: [69, 56, 48, 1, 96]
The sorted list is: [56, 69, 48, 1, 96]
The sorted list is: [48, 69, 56, 1, 96]
The sorted list is: [1, 69, 56, 48, 96]
The sorted list is: [1, 56, 69, 48, 96]
The sorted list is: [1, 48, 69, 56, 96]
The sorted list is: [1, 48, 56, 69, 96]

RESULT

Thus the above program was executed successfully and output was verified

26
Date:
Ex.No : 12

AIM To Write a Python Program to multiply two matrices.

Procedure :

Step 1: Start
Step 2: Declare matrix A[m][n]
and matrix B[p][q]
and matrix C[m][q]
Step 3: Read m, n, p, q.
Step 4: Now check if the matrix can be multiplied or not, if n is not equal to q matrix can't be
multiplied and an error message is generated.
Step 5: Read A[][] and B[][]
Step 4: Declare variable i=0, k=0 , j=0 and sum=0
Step 5: Repeat Step until i < m
5.1: Repeat Step until j < q
5.1.1: Repeat Step until k < p
Set sum= sum + A[i][k] * B[k][j]
Set multiply[i][j] = sum;
Set sum = 0 and k=k+1
5.1.2: Set j=j+1
5.2: Set i=i+1
Step 6: C is the required matrix.

27
PROGRAM :

# Define two matrix A and B in program


A = [[5, 4, 3],
[2, 4, 6],
[4, 7, 9]]
B = [[3, 2, 4],
[4, 3, 6],
[2, 7, 5]]
# Define an empty matrix to store multiplication result
multiResult = [[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]
# Using nested for loop method on A & B matrix
for m in range(len(A)):
for n in range(len(B[0])):
for o in range(len(B)):
multiResult[m][n] += A[m][o] * B[o][n] # Storing
multiplication result in empty matrix
# Printing multiplication result in the output
print("The multiplication result of matrix A and B is: ")
for res in multiResult:
print(res)

OUTPUT

The multiplication result of matrix A and B is:


[37, 43, 59]
[34, 58, 62]
[58, 92, 103]

RESULT

Thus the above program was executed successfully and output was verified

28
Date:
Ex.No : 13

AIM Write a Python program to demonstrate different operations on Tuple.

Procedure :

1. Start
2. Assign Values for tuple1
3. Assign Values for tuple2
4. For concatenation operation jpon two tuples by t3=t1+t2
5. For Repetition operation jpon two tuples by t4=t3*2
6. For Length of tuple l=len(t3)
7. Find min and maximum of tuple
8. Print Concatenation Tuple
9. Print Repetition Tuple
10. Print Length of Tuple
11. End

PROGRAM :

"""Write a Python program to demonstrate different operations on Tuple.


""Program to implement the follwing operation on Tuple
i. Concatenation
ii. Repetition
iii. Finding the lenth
iv. To find the maximum and minimum element *"* """

t1 =(17,'bat',97.5, 'cat', 'dog')

t2=(89.7,45,76)

t3=t1+t2 # Cocatenation

t4=t3*2 # Repetition

l=len(t3) # Finding the length of tuple 13

print("The concatenated tuple is: ",t3)

print("The repeated tuple is: ",t4)

print("The length of the tuple t3 is: ",l)

print("The minimum and maximum elements in tuple t2 are:",min(t2),max(t2))

29
OUTPUT

The concatenated tuple is: (17, 'bat', 97.5, 'cat', 'dog', 89.7, 45, 76)
The repeated tuple is: (17, 'bat', 97.5, 'cat', 'dog', 89.7, 45, 76, 17, 'bat', 97.5, 'cat', 'dog', 89.7, 45, 76)
The length of the tuple t3 is: 8
The minimum and maximum elements in tuple t2 are: 45 89.7

RESULT

Thus the above program was executed successfully and output was verified

30
Date:
Ex.No : 14

AIM To Write a Python Program to demonstrate to use Dictionary and related functions.

Procedure :

1. Start
2. Assign Values for Dictionary
3. To find the length of Dictionary
4. To copy
5. To remove an element from the given key
6. To get an element from the given key
7. To view key-value pair in list
8. To get value as a list
9. To remove the last item
10. To remove all elements
11. End

PROGRAM :

d={1001: "Rami", 1002: "Babu", 1003:"Kumar", 1004: "Somu", 1005: "Sita"}


print("The length of the dictionary is:", len(d))
print("The copied dictionary is:",d.copy())
print("The removed element is: ",d.pop(1003))
print("The dictionary d after removing 1003 is:", d)
print("The element in 1002 key is: ",d.get(1002))
print("The key-value pair as a tuple in a list is:",d.items())
print("The dictionary values as a list is: ",d.values())
print("The removed last item from dictionary is:",d.popitem())
d.clear()
print("The dictionary after removing all elements is: ",d)

31
OUTPUT

The length of the dictionary is: 5


The copied dictionary is: {1001: 'Rami', 1002: 'Babu', 1003: 'Kumar', 1004: 'Somu', 1005: 'Sita'}
The removed element is: Kumar
The dictionary d after removing 1003 is: {1001: 'Rami', 1002: 'Babu', 1004: 'Somu', 1005: 'Sita'}
The element in 1002 key is: Babu
The key-value pair as a tuple in a list is: dict_items([(1001, 'Rami'), (1002, 'Babu'), (1004, 'Somu'), (1005,
'Sita')])
The dictionary values as a list is: dict_values(['Rami', 'Babu', 'Somu', 'Sita'])
The removed last item from dictionary is: (1005, 'Sita')
The dictionary after removing all elements is: {}

RESULT

Thus the above program was executed successfully and output was verified

32
Date:
Ex.No : 15

To Write a Python Program to copy file contents from one file to another and display number of
AIM
words copied.

Procedure :

1. Start
2. Open file1 in read mode
3. Open file2 in write mode
4. Read file1 content count no.of words and write to file2
5. Print no.of words copied to file2
6. End

PROGRAM :

with open('file1.txt','w') as f:
n=int(input("Enter the number of lines of data:"))
for i in range(n):
data=input("Enter the next line of data:")
f.write(data +'\n')
with open('file1.txt', 'r') as f: #Opening filel in read mode
with open('file2.txt', 'w') as s: # Opening file2 in write mode to copy
filel
for i in f:
s.write(i)
with open('file2.txt', 'r') as s:
print("The content of file2 is: \n",s.read())
with open('file1.txt', 'r') as f:
d=f.read()
l=d.split()
count=0
for i in l:
count=count+1
print("Number of words copied from filel to file2 is:",count)

33
OUTPUT

file1.txt

Welcome to KSR Polytechnic College


Department of Computer Engineering
Tiruchengode

File2.txt

Welcome to KSR Polytechnic College


Department of Computer Engineering
Tiruchengode

Number of words copied from filel to file2 is: 10

RESULT

Thus the above program was executed successfully and output was verified

34

You might also like