"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 / debmalya paul
package Stringmltp;
import java.util.Scanner;
public class country {
static Scanner in=new Scanner(System.in);
void rev()
{
String s=in.nextLine();
System.out.print(s.substring(10,17) +" "+ s.substring(7,9) +" "+ s.substring(2,6) +" "+ s.substring(0,1));
}
public static void main(String []args)
{
country cn=new country();
cn.rev();
}
}
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
What is the -> in c?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What is the size of array float a(10)?
What is hungarian notation? Is it worthwhile?
How do you sort filenames in a directory?
Is c is a middle level language?
How can you invoke another program from within a C program?
What are the data types present in c?
What is the difference between local variable and global variable in c?
What is operator precedence?
Can we change the value of static variable in c?
Why do we use & in c?
Can you tell me how to check whether a linked list is circular?
How do you write a program which produces its own source code as output?
What is define c?