"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

i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

1525


In C programming, how do you insert quote characters (‘ and “) into the output screen?

895


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2189


How can you be sure that a program follows the ANSI C standard?

1127


What is use of integral promotions in c?

666






Why calloc is better than malloc?

572


What is property type c?

605


What is c++ used for today?

665


How can you determine the size of an allocated portion of memory?

745


How can I direct output to the printer?

812


How do I use void main?

631


Can we assign integer value to char in c?

617


what are bit fields? What is the use of bit fields in a structure declaration?

1499


What are all different types of pointers in c?

578


Can you pass an entire structure to functions?

696