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 |
Why are all header files not declared in every c program?
Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.
7 Answers Accenture, Gridco, IBM, Kevin IT, TCS, Vimukti Technologies,
What is wrong with this declaration?
Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.
What is the difference between exit() and _exit()?
Who invented bcpl language?
Write a program in C to convert date displayed in gregorian to julian date
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
In which mode we open the file for read,write and append also in c ? a)W b)w+ c)r+ d)a
write a program in c to find out the sum of digits of a number.but here is a condition that compiler sums the value from left to right....not right to left..
Program to find larger of the two numbers without using if-else,while,for,switch
What does stand for?