Develop a C program for File Operations that stores n number of the Alphabets from A to Z in a file and display it.
Input :
11
80
Output :
P
Q
R
S
T
U
V
W
X
Y
Z
#include <stdio.h>
#include <stdlib.h>
void main( void){
FILE *fpFileAlphabets;
int numberLetters;
int startLetter;
int letterASCII;
scanf("%d",&numberLetters);
scanf("%d",&startLetter);
fpFileAlphabets = fopen("Alphabets.txt", "w+");
printf("\n");
for(letterASCII=startLetter;letterASCII<startLetter+numberLetters;letterASCII++){
fprintf(fpFileAlphabets,"%c\n",letterASCII);
printf("%c\n",letterASCII);
}
fclose(fpFileAlphabets);
getchar();
getchar();
}
Comments
Leave a comment