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 do u mean by Direct access files? then can u explain about Direct Access Files?
What is the use of getchar() function?
main() { int a[10]; printf("%d",*a+1-*a+3); }
char ch=10;printf("%d",ch);what is the output
IS it possible to define a zero sized array in c.if it is possible how can the elements of that array can be accessed.array index starts from zero,if it is possible to define zero sized array how can be its first element can be accesseed.
What is the purpose of sprintf?
What is a null string in c?
Explain what is the concatenation operator?
Write the following function in C. stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return - 1. The function should not make use of any C library function calls.
3 Answers Google, Infosys, JTL, OpenFeel,
What is declaration and definition in c?
what is function pointer?
How can I call fortran?