Hi Friends,

Can you plzz tell me whats wrong with this code.

#include <stdio.h>
#include <math.h>

main () {

 FILE *fp;

  fp = fopen("file.txt", "r");
  if(fp==NULL){
   printf("\n Cannot open file.txt file.\n");
   exit(1);
  }
  else {
   printf("\n file.txt File is Opened.\n");

  }
}

The file.txt is not having any value but surprisingly iam getting the following 
message when i run the above code

 file.txt File is Opened.

Can you please tell me why iam getting this?

Thanks in advance.
ss..



[Non-text portions of this message have been removed]

Reply via email to