how to code caeser cipher encrytion using file in c? : for caeser cipher enenrytion i have this code.This program uses text written by the user.But I want this to be read from a txt file and run.Thanks in advance :) 

  

      #include<stdio.h>
    #include <conio.h>
    #include<string.h>
    void main()
    {
    int key,i;
    char [30];
    clrscr();
    printf("\n enter plain text : ");
    gets(data);
    printf("\ enter key value : ");
    scanf("%d",&key);
    {
    for(i=o;i<strlen(data);i++){
    if (data[i]==' ') {}
    else
    {
    if (data[i]>='x')
    {
    data[i]=data[i]-26;
    }
    data[i]=data[i]+key;
    }
    }
    } 
    printf("your cipher text is : %s",data);
    getch();
    }