Here is alphabets : abcdefgh
1) how to reverse. as hgfedcba
2) after reversal, how to group them in a pair hg fe dc ba.
Answer Posted / ruchi
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
int i,c;
char p[]="abcdefgh";
i=strlen(p);
for(c=i;c>=0;c--)
{
printf("%c",p[c]);
}
for(c=i;c>=0;c--)
{
printf("%c",p[c]);
if(c%2==0)
{
printf(" ");
}
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
pierrot's divisor program using c or c++ code
How do I determine whether a character is numeric, alphabetic, and so on?
What are the restrictions of a modulus operator?
How do I use strcmp?
Is there a way to compare two structure variables?
Is stack a keyword in c?
What is switch in c?
Is it possible to pass an entire structure to functions?
In c programming language, how many parameters can be passed to a function ?
What is difference between structure and union?
What is getche() function?
What is an auto keyword in c?
develop algorithms to add polynomials (i) in one variable
Explain about block scope in c?
What is c language in simple words?