Write a program to display Characters from A to Z Using Loop
Example:
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
Approach
C
#include <stdio.h>int main(){for (int i = 0; i < 26; i++){printf("%c ", i + 'A');}return 0;}
Java
public class DisplayCharAtoZ {public static void main(String[] args) {for (int i = 0; i < 26; i++) {System.out.printf("%c ", i + 'A');}}}
No comments:
Post a Comment