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 |
In scanf h is used for
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?
What is hungarian notation? Is it worthwhile?
#define MAX 3 main() { printf("MAX = %d \n",MAX ); #undef MAX #ifdef MAX printf("Vector Instituteā); #endif
What will be the outcome of the following conditional statement if the value of variable s is 10?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
What does c mean in basketball?
Why is event driven programming or procedural programming, better within specific scenario?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
What's the difference between DELETE TABLE and TRUNCATE TABLE commands?
Are negative numbers true in c?
What is c preprocessor mean?