How to Create Your Own Command in C
Get Certified in C Programming and Take Your Skills to the Next Level
Program 1
#include<stdio.h>
#include<conio.h>
int main(int argc,char *argv[])
{
if(argc==2)
{
FILE *fp=NULL;
fp=fopen(argv[1],"r");
if(fp==NULL)
printf("File not found");
else
{
char ch;
while(((ch=fgetc(fp))!=EOF))
{
printf("%c",ch);
}
fclose(fp);
}
}
else
printf("Invalid command....");
}
We work very hard to provide you quality material
Could you take 15 seconds and share your happy experience on Google

