PF.docx - QUESTION 1#include <stdio.h>#include <string.h> int main char arr[15]= int right,i,left,j,space,flag=0 int s b printf\"enter a string gets(arr

PF.docx - QUESTION 1#include <stdio.h>#include <string.h>...

This preview shows page 1 - 5 out of 5 pages.

QUESTION# 1 #include <stdio.h> #include <string.h> int main() { char arr[15]=" "; int right,i,left,j,space,flag=0; int s, b; printf("enter a string : "); gets(arr); int len=strlen(arr); for(space=0;space<len-1;space++) { for(left= 0 ,right=space+1;left<=len/2+1&&right<len;right+ +,left++) { flag=0; for(i=left,j=right;i<j;j--,i++) { if(arr[i]!=arr[j]) { flag=1; break; } } if(flag==0)
Image of page 1
{ for(s=left;s<=right;s++) { printf("%c",arr[s]); } printf("\n"); } } } } QUESTION# 2 #include <stdio.h> int fun(char,int,int); int main () { char a='e'; int b=5,c=1; fun(a,b,c); } int fun (char a,int b,int c) {
Image of page 2
if (b<1) return b; else { if (b<c) { printf ("\n"); a='e'; fun(a,b-1,1);
Image of page 3
Image of page 4
Image of page 5

You've reached the end of your free preview.

Want to read all 5 pages?

  • Fall '19
  • Void type, #include, int Right, sortingarr

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes