Check palindrome


why its not producing output

hello @lovely
image

the input is in this format.
u cannot read all n numbers
just by doing cin>>str // it will read only first number 1 for this case

declare array of string/integer and then use loop to read n times.
also in while loop u need to break the loop if u find any mismatch.

@lovely

pls check ur updated code here->

can we do it without bool function ? without bool its producing both true false

yeah u can , u need to stop ur program in the else section only .

for that put return 0;(in place of break) inside else section

1 Like

ok thanks :slightly_smiling_face: