Joined
Last Seen
0 Reputation Points
Unknown Quality Score
No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
0 Endorsements
Ranked #107.41K
~139 People Reached
Favorite Forums
Computer Science
x
1
what is the Running time of the given code? #include<stdio.h> int main(){ char str[100]; int i=0,j=-1,flag=0; printf("Enter a string: "); scanf("%s",str); while(str[++j]!='\0'); j--; while(i<j) if(str[i++] != str[j--]){ flag=1; break; } if(flag == 0) printf("The string is a palindrome"); else printf("The string is not a palindrome"); return 0; } |