you can use the ASCII code to print a - z.... using for loop, initialize the variable to 97, I think that's the ASCII code of small letter "a".... But to make sure, try check it to the book.... then, the loop will continue until it reaches 122, because that's the ASCII code of small letter "z".... then, print it using %c to print the equivalence of the number..... so this is how your program looks like: void main(void) { int i; clrscr(); for(i = 97; i <= 122; i++) printf("%c",i); getch(); } OR void main(void) { char letter; clrscr(); for(letter = 'a'; letter <= 'z'; letter++) printf("%c",letter); getch(); }
Printing all alphabets A-Z. 'C' code is here Code: #include<stdio.h> #include<conio.h> void main() { int i,j,k=65; clrscr(); for(i=0;i<5,i++) { for(j=0;j<5;j++) { printf("%c\t",k); k++; } printf("\n"); } getch(); } above code will print A B C D E F G H I J K L M N O P Q R S T U V W X Y