Sunday, March 18, 2012

To print the reverse of character.

//To print the reverse of character.
#include<stdio.h>
#include<conio.h>
main()
{     int i;
      char a[5];
      printf("Enter the name- ");
      for(i=0;i<5;i++)
      scanf("%c",&a[i]);
      printf("Your name is: ");
      for(i=0;i<5;i++)
      printf("%c",a[i]);
      printf("\nYour reverse  name is: ");
      for(i=4;i>=0;i--)
      printf("%c",a[i]);
      getch();
      }

No comments:

Post a Comment