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
Explain can the sizeof operator be used to tell the size of an array passed to a function?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
Differentiate between a structure and a union.
Why is sprintf unsafe?
Discuss the function of conditional operator, size of operator and comma operator with examples.
Write a progarm to find the length of string using switch case?
What are data structures in c and how to use them?
What does do in c?
What are all different types of pointers in c?
what is the diffrenet bettwen HTTP and internet protocol
What is pointer in c?
Why main function is special give two reasons?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
What is unsigned int in c?
What is structure in c explain with example?