14123 - EE2310_Lab9_1   

Description

/* -- Redo the palindrome problem using recursion. Modify the following code. -- */

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

/* uint8_t is just a char */
uint8_t is_palindrome(/* define your own arguments */) {
/*
 * Your code here
 */
}


int main(){
   char temp_c, str[32];
   int i=0, len=1;
   do{ // getting input from user
     scanf("%c", &temp_c);
     if(temp_c!=' ' && temp_c!='\n')
       str[i++] = temp_c;
   } while(temp_c!=' ' && temp_c!='\n' && i<30);
   len = i - 1; //current i is string length

   if(is_palindrome(/* add your own arguments */) {
     printf("a palindrome\n");
   } else {
     printf("not a palindrome\n");
   }
   return 0;
}

 

Input

abcba

Output

a palindrome

Sample Input  Download

Sample Output  Download

Tags




Discuss