Hai,
Can anyone help me to solve this program.

Write a function in C++ to count number of words starting with “amend” in the text file named as “Amendment.txt”
Eg:-
A contract to deliver something to a customer once a month can be amended if the customerwants it delivered once a week. Usually, everyone involved in the contract must agree to the
amendment before it goes into effect. Most contracts are written with rules about amendments
The Output should be
No of words starting with amend : 3

Sounds like you need to learn how to read argvars, open a file handle, read a file handle, parse a string in a buffer, and increment a value.

Good luck!

Write a program which adds all the natural numbers below 3000 and greater than 500 that
are multiples of 3 or 5 but not both in c++.

@Atiq_1 ... you may not yet have learned that it is NOT appropriate to 'hijack' an other poster's thread ? So please post your beginner level question in a NEW thread.

Also, you need to know that you MUST make an effect to code a solution and post the code that you have tried, if you actually expect anyone here to see how to help you. <Your homework MUST be YOUR work.> We are glad to help you to learn ... but we can not do your work for you, or else we would be the ones to be hired by any of your possible future employers.

@Hia ... please read and understand the (2nd part of the) above also.
HINT! You could use a loop ... while( fin >> word ) { // ... // }... to read the words in your file ... etc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.