शुरुआती लोगों के लिए लूप कैसे काम करता है यह समझने के लिए यह एक बहुत ही सरल प्रोग्राम है।
C Programming Examples:
- Write a C Program to print A to Z numbers.
- C program to print A to Z numbers using for loop.
- C program to print A to Z numbers using while loop.
- C program to print A to Z numbers without using loop.
C Program to Print A to Z Numbers Using For Loop :
#include<stdio.h>
int main()
{
int i;
for(i=65;i<=90;i++)
{
printf("%d\n",i);
}
}
Read more:
C Program to Print A to Z Numbers Using While Loop :
#include<stdio.h>
int main() {
int i=65;
//i is less than or equal to 90
while( i <= 90) {
//print the value of i
printf("%d\n", i);
//Increment the value of i
i++;
}
return 0;
}
Explanation of Printing A to Z Numbers in C:
1) i को पूर्णांक के रूप में इनिशियलाइज़ करता है।
2) अब i=65 और 90 से कम है इसलिए कंडीशन संतुष्ट करती है और i के मान को प्रिंट करती है जो कि 1 है। जो '2' है
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