What would you like to do?

How do you write a program using command line arguments?

already exists.

Would you like to merge this question into it?

already exists as an alternate of this question.

Would you like to make it the primary and merge this question into it?

exists and is an alternate of .

#include<stdio.h>
int main( int argc, char *argv[])
{

FILE *p;
if(!argv[1])
{
printf("can't open the file");
}
else
p=fopen("venki.txt","r" );


return 0;
}
Thanks for the feedback!

Product of two numbers using command line arguments?

class product  { public static void main(String args[]) { int a=Integer.parseInt(args[0]); int b=Integer.parseInt(args[1]); int c=a*b; System.out.println(c); }   } outpu

What are command line arguments?

  Command line arguments are provided at the time of running the program.   Example: Suppose that your program needs input name and its value then running it from comma

Write a program to echo the arguments given in the command line?

The main method in Java has a string array parameter that contains the arguments passed in. Example: import java.util.Arrays; public class A { public static void main(S

Program to add two numbers using command line argument?

public class TwoNumbers { · public static void main(String args[]){ · · int first_number = Integer.parseInt(args[0]); · int second_number = Integer.parseInt(args[1]);

Program to copy one file into another using command line arguments?

include #include #include #include #include #include #include int main(int argc,char * argv[]) { int fp,ft,buffsize=10; char *buff=(char *)malloc(sizeof(ch

What are command line arguments in Java and how they are useful?

Command line arguments in Java are, as with most programming languages, a way to give information to a program at the point of invoking (starting to run) that program. The inf