Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



How to print all the 26 alphabets in this order in C. AbCdEfGh..... it should print dynamical..

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

How to print all the 26 alphabets in this order in C. AbCdEfGh..... it should print dynamical..

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

Post New Answer

More C Interview Questions

What standard functions are available to manipulate strings?

0 Answers  


What is indirection? How many levels of pointers can you have?

0 Answers   Aspire, Infogain,


Explain what is the difference between functions abs() and fabs()?

0 Answers  


What is the value of h?

0 Answers  


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

0 Answers   TCS,


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?

2 Answers  


What is C language Terminator?

15 Answers   TCS,


DIFFERNCE BETWEEN THE C++ AND C LANGUAGE?

2 Answers   Wipro,


code for copying two strings with out strcpy() function.

6 Answers  


What do you mean by dynamic memory allocation in c?

0 Answers  


#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);}

3 Answers  


All technical questions

0 Answers   TCS,


Categories