C command line program code using argv if -else loop
#include<stdio.h>
#include<conio.h>
void main(int argc,char*argv[])
{
FILE *fp;
char s[100];
clrscr();
printf("\nNumber of argument on command line =%d\n",argc);
if(argc<2)
{
printf("forget the file name\n");
}
else
{
printf("\nNo parameter on the command line");
}
getch();
}
Examples for C command line program code using argv if -else loop
#include<stdio.h>
#include<conio.h>
void main(int argc,char*argv[])
{
FILE *fp;
char s[100];
clrscr();
printf("\nNumber of argument on command line =%d\n",argc);
if(argc<2)
{
printf("forget the file name\n");
}
else
{
printf("\nNo parameter on the command line");
}
getch();
}
Examples for C command line program code using argv if -else loop
0 comments: