Tuesday, May 2, 2017

WAP to write "Welcome To Geomatics Engineering" on a file 'test.txt'.

#include<stdio.h>
#include<conio.h>
main()
{
    FILE *fp;
    fp=fopen("test.txt","w");
    if(fp==NULL)
    {
        printf("FILE CAN NOT BE CREATED");
        exit(1);
    }
    else
    {
        printf("FILES SUCCESSFULLY CREATED");
       
    }
    fputs("Welcome To Geomatics Engineering",fp);
    fclose(fp);
    getch();
}

No comments:

Post a Comment

Return Type Funtion without passing any Argument.

#include<stdio.h> #include<conio.h> int sum(); main() { int x; x=sum(); printf("Sum= %d",x); getch(); } int sum(int x...