#include<stdio.h>
#include<stdlib.h>
void main(){
    FILE *fp;
    char str[20];
    fp=fopen("krishna.txt","a");
    if(fp==NULL)
        printf("File not exist");
        exit(1);
    printf("Enter the strings:");
    
    gets(str);
    fputs(str,fp);
    //fprintf(fp,"%s",str);
    printf("Successfully print");
    fclose(fp);
}
why it is not appending
i want this to append in my existing file name krishna
 
    