Loading

Showing posts with label text. Show all posts

c program to copy a text file

C Program to Copy a Text File


#include<stdio.h>
#include<conio.h>

void main()
{
  FILE *fp1,*fp2;
  char file1[500],file2[500];
  char x;
  printf("\nENTER THE SOURCE FILE:");
  gets(file1);
  fp1=fopen(file1,"rb");
  printf("\nENTER THE DESTINATION FILE:");
  gets(file2);
  fp2=fopen(file2,"wb");
  if(fp1!=NULL && fp2!=NULL)
  {
    while((x=getc(fp1))!=EOF)
    putc(x,fp2);

  }

  else
    printf("\nERROR CREATING FILE...");

  fclose(fp1);
  fclose(fp2);
  getch();
 }

Posted in , , , | Leave a comment

c program to display blinking text/character

C Program to Display Blinking Text/Character


#include <conio.h>

int main(void)
{
   int i;

   clrscr();
   for (i=0; i<9; i++)
   {
       textattr(i + ((i+1) << 4));
       cprintf("This is a test\r\n");
   }

   return 0;
}

Posted in , , , | Leave a comment