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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the basis for selection of arrays or pointers as data structure in a program

3784


What is actual argument?

587


What are comments and how do you insert it in a C program?

737


write a program to create a sparse matrix using dynamic memory allocation.

4370


find out largest elemant of diagonalmatrix

1646






Why calloc is better than malloc?

570


How do you generate random numbers in C?

653


Differentiate abs() function from fabs() function.

590


What are global variables and explain how do you declare them?

569


How can you return multiple values from a function?

626


What is the best way of making my program efficient?

561


What is non linear data structure in c?

567


What is a lvalue

657


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

766


What are reserved words with a programming language?

599