online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include<stdio.h> int numberOfCharacters(char x[100]){//raja int count = 0; for(int i=0;x[i];i++){ count++; } return count; } int isAnagram(char x[200], char y[200]){ for(int i=0;x[i];i++){//Time => O(count^2) char k = x[i]; for(int j=0;y[j];j++){ char h = y[j]; if(k==h){ y[j] = '$'; break; } } } int flag = 0; for(int i=0;y[i];i++){ //Time => O(count) if(y[i]!='$'){ flag++; break; } } return flag; } int main(){ char x[200]; char y[200]; scanf("%[^\n]s",x); scanf("\n%[^\n]s",y); int count1 = numberOfCharacters(x); int count2 = numberOfCharacters(y); if(count1!=count2) printf("Not an anagram..."); else{ int res = isAnagram(x,y); if(res==0) printf("Anagram..."); else printf("Not an Anagram..."); } return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue