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 |
What standard functions are available to manipulate strings?
What is indirection? How many levels of pointers can you have?
Explain what is the difference between functions abs() and fabs()?
What is the value of h?
Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer
Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use an external variable to store the count. Second, use a local variable. Which is more appropriate?
What is C language Terminator?
DIFFERNCE BETWEEN THE C++ AND C LANGUAGE?
code for copying two strings with out strcpy() function.
What do you mean by dynamic memory allocation in c?
#define min((a),(b)) ((a)<(b))?(a):(b) main() { int i=0,a[20],*ptr; ptr=a; while(min(ptr++,&a[9])<&a[8]) i=i+1; printf("i=%d\n",i);}
All technical questions