online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> #include <stdlib.h> #include <string.h> //#include <time.h> /* void printArr(int arr[], int n){ for (int i=0; i<n; i++) { printf("%d ", arr[i]); } printf("\n"); } void swap(int* a, int* b){ int t = *a; *a = *b; *b = t; } int main() { const int MAX = 99; const int MIN =-300; const int TOT = 25; int arr[25], t=5, arr2[20]; srand(time(NULL)); for (int i=0; i<25; i++) { arr[i] = rand()%(MAX+1-MIN)+MIN; } printf("min: %d, max:%d\n", MIN, MAX); printArr(arr, TOT); for (int i = 0; i < TOT - 1; i++) { for (int j = 0; j < TOT - 1; j++) { int a = j, b = j + 1; if(arr[a] < arr[b]) swap(&arr[a], &arr[b]); } } /* for( int i = 0; i < 24; i++) for(int j = 0; j < 23; j++) if (arr[i] < arr[j]) swap(&arr[i], &arr[j]);*/ /*int j, x; for(int i= 0; i<25; i++){ x= arr[i]; j = i + 1; while((arr[i]>arr[j+1])&&(j<25)) j++; arr[i] = arr[j]; arr[j] = x; } printf("\n"); printArr(arr, TOT); return 0; } */ int isVMin(char c){ return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y'; } int isNum(char c){ return c>='0' && c<='9'; } int removeChars(char str[]){ int slen = strlen(str); //char* res = malloc(sizeof(char)*slen+1); char res[slen + 1]; printf("\nthe initial is: '%s'\n", res); int numCount = 0, j = 0; for (int i = 0; i < slen; i++) { if (isVMin(str[i])); //str[i]= ' '; else { res[j++] = str[i]; if (isNum(str[i])) numCount++; } } res[j] = '\0'; printf("\nthe removed is: '%s'\n", res); //str = res; return numCount; } int main(){ char phrase[50]; gets(phrase); int nb = removeChars(phrase); printf("\nLa phrase '%s' contient %d digits", phrase, nb); 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