Write a C program for File Operations to read a string from standard input and prints the entered string using fgets() and fputs() function.
Develop a C program for File Operations that stores n number of the Alphabets from A to Z in a file and display it.
Runtime Input :
11
80
Output :
P
Q
R
S
T
Develop a C program for File Operations that stores n number of the Alphabets from A to Z in a file and display it.
Mr. John needs to deliver goods from Supermarket to customers house in a two-storey apartment. Owner wants to know the location where John has delivered the goods. The total distance from the store to apartment is 400 steps. To go to 2nd Floor, John need to go 25 steps extra. The distance for 1st floor is less than 25 steps.
If John has crossed more than 425 steps then he has delivered in 2nd Floor. If total steps of John is between 400 to 425 then he has delivered in 1st Floor else John has delivered in Ground floor.
A software need to be developed, to check which floor John has delivered the goods.
Following are requirements to solve the problem
a. Capture the number of steps John used after reaching the building.
b. Add with the distance from Store to apartment. i.e., 400+ steps by John.
c. Compare the total distance travel.
d. Display the appropriate result.
Mr. Seth is a Goldsmith. He wants to know the amount of money earned from the sale.
On a Normal day, i.e., Weekday there is a sale of Rs. 10000/- which is fixed. On a weekend, there is an additional sale of Rs. 5000/- , and on a festival day (be it either week day or week end), there is an additional sale of Rs. 20000/-.
Following are requirements to solve the problem
a. The type of day i.e., weekend or festival day has to be captured.
b. Check for the type of day and compute the total amount of sale
c. Display the amount of sale in Rupees.
Mr. Sharma has travel plans. He wants to know the distance ravelled in kilometers [KM] to
destination on October 15th. Initially Mr. Sharma travels a fixed distance of 40 KM from his
house to Airport. If October 15th is a Full working day he travels 2200 KM to attend al
Conference at Delhi. if it is a half working day he travels 350 KM to attend a Conference at l
Chennai. if it is a Holiday he travels 600 KM for a Holiday in Goa.
Following are requirements to solve the problem
a. The working day status i.e. Full working day. half working day or Holiday on October 15th
has to be caplured.
b. Check for the given conditions and compute the total distance
c. Display the distance travelled in KM along with the destination in an appropriate message.
Two of them travelling in a car who is sitting in back seat. He saw the mirror image of a word written on a vehicle as ecnalubma. Write a C programming to display the original word
input : ecnalubma
Output : ambulance
Write a program to carry out the following:
To read a text file “TRIAL.TXT” consisting of a maximum of 50 lines of text,
each line with a maximum of 80 characters.
Count and display the number of words contained in the file.
Display the total number of four letter words in the text file.
Assume that the end of a word may be a space, comma or a full-stop followed by one
or more spaces or a newline character.
Write a program to carry out the following:
(a) Read a text file ‘INPUT.TXT’
(b) Print each word in reverse order
Example,
Input: PAKISTAN IS MY COUNTRY
Output: NATSIKAP SI YM YRTNUOC
Assume that each word length is maximum of 10 characters and each word is
separated by newline/blank characters.
Write a program to add the contents of one file at the end of another.