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
what is the role you expect in software industry?
What is structure of c program?
Explain what are linked list?
What does sizeof int return?
What is pass by reference in functions?
What are header files and what are its uses in C programming?
What are the types of c language?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
what type of questions arrive in interview over c programming?
What is the advantage of a random access file?
What does c mean before a date?
What library is sizeof in c?
How can I split up a string into whitespace-separated fields?
Should a function contain a return statement if it does not return a value?
What is string function in c?