"I LOVE MY COUNTRY"
write a c program to get "COUNTRY MY LOVE I" as the output.

Use any other programming language. It is not mandatory to
use C.

Answer Posted / shaik

#include<stdio.h>

void main ()
{
char str1[]="I LOVE MY COUNTRY",str2[20];
int count,i;
clrscr();
i=0;
While (str1[i]!='')
{
count++;
i++;
}
i=0;
while (str1[i]!='')
{
str2[count-1-i]=str1[i];
i++;
}
str2[i]='';
printf ("reversed string is %s",str2);
getch ();
} // guys check for the syntax typed from phone sry

Is This Answer Correct ?    11 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

hi send me sample aptitude papers of cts?

1644


In C programming, what command or code can be used to determine if a number of odd or even?

616


Is it possible to initialize a variable at the time it was declared?

745


Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc

5051


What is a pragma?

660






Why do we use static in c?

627


4. main() { int c=- -2; printf("c=%d",c); }

1362


What are the disadvantages of c language?

610


What is the explanation for modular programming?

675


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

653


Explain how do you convert strings to numbers in c?

587


Explain the ternary tree?

593


What is the -> in c?

573


Differentiate between #include<...> and #include '...'

612


What is wrong in this statement?

595