C Program to print all the English Alphabets in Upper case

Output:

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 Z

Try your Solution

Strongly recommended to Solve it on your own, Don't directly go to the solution given below.

#include<stdio.h> int main() { //write your code here }

Program or Solution

				
			
					
#include<stdio.h>
int main()
{
	int i;
	for(i='A';i<='Z';i++)
	{
		printf("%c",i);
	}
	return 0;
}
			
				
			

Program Explanation

Instruction(s) inside the for block{} are executed repeatedly till the second expression is true.

Here i is initialized to A(65) and incremented by 1 for each iteration, instructions inside the for block are executed unless i becomes greater than Z(90).

so value of i will be printed as character like AB C....Z using printf statement and format specifier %c.

Comments


Related Programs