WAP to check whether a given word exists in a file or not. If yes then find the number of times it occurs.
Computer Programming Lab
WAP to compare the contents of two files and determine whether they are same or not.
WAP to swap two elements using the concept of pointers.
Define a structure data type TRAIN_INFO. The type contain
Train No.: integer type
Train name: string
Departure Time: aggregate type TIME
Arrival Time : aggregate type TIME
Start station: string
End station : string
The structure type Time contains two integer members: hour and minute. Maintain a train timetable and implement the following operations:
(i) List all the trains (sorted according to train number) that depart from a particular section.
WAP to implement strlen (), strcat (),strcpy () using the concept of Functions.
1. Length of the string (strlen)
The syntax of strlen is :
It calculates the length of the string and returns its length. For example:
string = "Mumbai";
printf("Length = %d",strlen(string));
The above code displays 5, because Mumbai consists of 5 characters. Note: it does not count null character.
2. Joining two strings (strcat)
WAP that finds the sum of diagonal elements of a mxn matrix
WAP to add and multiply two matrices of order nxn.
WAP to sort the elements of the array in ascending order using Bubble Sort technique.
WAP to search an element in a array using Linear Search.
WAP to find the minimum and maximum element of the array