C language interview questions solution for freshers beginners placement tricky good pointers answers explanation operators data types arrays structures functions recursion preprocessors looping file handling strings switch case if else printf advance linux objective mcq faq online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c++ tutorials and pdf
CONCATENATE MANY FILES AND STORE THEM IN A FILE NAMED FILES USING C PROGRAM
#include"stdio.h"
void concatenate(FILE *fp1,FILE *fp2,char *argv[],int argc);
void main(int argc,char *argv[])
{
FILE *fp1,*fp2;
concatenate(fp1,fp2,argv,argc);
getch();
}
void concatenate(FILE *fp1,FILE *fp2,char **argv,int argc)
{
int i,ch;
fp2=fopen("files","a");
for(i=1;i
{
fp1=fopen(argv[i],"r");
while((ch=getc(fp1))!=EOF)
putc(ch,fp2);
}
}
Subscribe to:
Post Comments (Atom)
1 comment:
What will be output of the program? Explain .
#include
void fun(int);
int main()
{
int a=30;
printf("%d\n",a);
return 0;
}
void fun(int b)
{
b=60;
printf("%d\n",b);
}
Post a Comment