0% found this document useful (0 votes)
33 views1 page

Lab2: Argument Arrays: Composite

The document describes 6 tasks for a lab assignment on argument arrays in C programming. The tasks involve writing programs that: 1) print all command line arguments, 2) sum all command line arguments, 3) tokenize a string from the command line, 4) concatenate command line arguments, 5) check if command line arguments are prime or composite numbers, and 6) add up the integer parts of a complex command line argument. Students are instructed to write code for each task and include execution results in their lab report.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

Lab2: Argument Arrays: Composite

The document describes 6 tasks for a lab assignment on argument arrays in C programming. The tasks involve writing programs that: 1) print all command line arguments, 2) sum all command line arguments, 3) tokenize a string from the command line, 4) concatenate command line arguments, 5) check if command line arguments are prime or composite numbers, and 6) add up the integer parts of a complex command line argument. Students are instructed to write code for each task and include execution results in their lab report.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Lab2:

Argument Arrays

Complete the following tasks and show its execution for different inputs. In your lab report,
show the program code and execution. Show execution using a transcript or screenshots.

Task 1: Write a C program that prints all the Command line arguments.

Task 2: Write a C program that performs the summation of all the command line arguments.

Task 3: Write a C program that makes tokenizes a string passed through the command line.

Task 4: Write a C program for concatenation of command line arguments.

Task 5: Write a C program that displays if the arguments passed at command line are prime or
composite.

Task 6: If you have a command line argument as follows:


225g2:6g33g55g66,5
Write a C program that adds up all the integer parts and displays the result.

You might also like