13617 - EECS2310_Lec_4_2   

Description

/* modify the following code to determine palindromes */

#include <stdio.h>
int main(){
   char temp_c, str[21];
   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<21);
   len = i; //current i is string length
   
   /*

    your palindrome logic


   */
   return 0;
}

 

 

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss