c语言:Display the capital letters of the alphabet backward from Z to A.
时间: 2024-05-06 09:21:12 浏览: 110
C语言从大到小输出数字
Sure, here's the code to display the capital letters of the alphabet backward from Z to A in C language:
```
#include<stdio.h>
int main() {
char ch='Z'; // Start with capital letter Z
while(ch >= 'A') { // Loop until A is reached
printf("%c ", ch); // Print the capital letter
ch--; // Decrement the character value
}
return 0;
}
```
Hope this helps!
阅读全文