2. Write a c program to delete a file.
3. Write a c program to copy a file from one location to other location.
6. Write a c program which writes string in the file.
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
7 comments:
DISPLAY SOURCE CODE AS OUTPUT IN C PROGRAM
#include
int main(){
FILE *p;
char ch;
p=fopen("raja.c","r");
while((ch=getc(p))!=-1)
putchar(ch);
fclose(p);
return 0;
}
*********************************************8
hi, this program not given the correct output,, plz check and reply me,,,,,,,,,,,,,,,,,,,,,,,,,
hi can you help me in getting a program for counting paragraph from a file??
And also for the lines too. please help me.
frnd just replace "name of ur programe" instead of "raja.c" in this code and try it will work...
#include
int main(){
FILE *p;
char ch;
p=fopen("raja.c","r");
while((ch=getc(p))!=-1)
putchar(ch);
fclose(p);
return 0;
}
please help me out with a C program for displaying the contents of the file..and also adding the entered string to the file..!!
can we give file name dynamically in this program ?
you are closing the file in the while loop !
Post a Comment