How to print all the 26 alphabets in this order in C.
AbCdEfGh.....
it should print dynamically from a to z and do not print
this using pgm like this print("Ab......");
Use loops or anything to print all alphabets
Answers were Sorted based on User's Feedback
Answer / jebarose
This can be done by using ASCII value...
ASCII value of A is 65
ASCII value of b is 98
Difference of Ab,Cd,Ef.(etc) is 33
A to C is 2.
This is the logic,while printing use %c,so tht it gets print
as Alphabets.
| Is This Answer Correct ? | 12 Yes | 1 No |
Answer / nitin garg
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main(){
char ch[26];
int a=65,b=98;
for(int i=0;i<26;i++)
{
ch[i]=a;
printf("%c ",ch[i]);
i++;
a=a+2;
ch[i]=b;
printf("%c ",ch[i]);
b=b+2;
}
getch();
return(0);
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Explain what is the difference between declaring a variable and defining a variable?
WHAT IS MEANT BY LIFE?
O,T,T,F,F,S,S,E,N,?,?,?,T,F,F,S,S,E,N
What is C++
Why is c used in embedded systems?
What is getch () for?
what is the difference between global variable & static variable declared out side all the function in the file.
What character terminates all strings composed of character arrays? 1) 0 2) . 3) END
Explain what is operator promotion?
Can a file other than a .h file be included with #include?
suppose there are five integers write a program to find larger among them without using if- else
What is wild pointer in c?