The greatest mistake you can make in life is to be continually fearing you will make one

Monday 17 May 2010

C Programs based on Command Line Arguments

  1. Write a program to read a text file provided at command prompt and print the content of the file
  2. Write a program to read a text file provided at command prompt and print each word in reverse order For example if the file contains WELCOME TO C output should be C OT EMOCLEW

  3. Write a program using command line arguments to search for a word in a file and replace it with the specified word.The usage of the program is shown below
    C > change < oldword > < newword > < filename >
  4. Write a program that canbe used at command prompt as a calculating utility.The usage of the program is shown below.
    C>calc < switch > < n > < m >
    where n and m are 2 integer operands. switch can be any one of the arithmeticor comparison operators. If arithmetic operator is supplied,the output should be the result of the operation.If comparison operator is supplied then the output should be True or false

No comments:

Post a Comment