For my passing exam I cannot use compiler is there any possible way so that I can find the exact output without compiler
I get confused how deal with while loops and for loop since string is updating
when for loops got end, I am having trouble
<code>#include<stdio.h>
void f (char *);
int main(void) {
char *s = "This 12345 Is A String 678";
char *d;
d = strdup (s);
f (d);
fprintf (stdout, "%s", d);
return (1);
}
void f (char *s) {
int i, j;
i = 0;
while (i < strlen(s)) {
if (s[i]==' ' || (s[i]>='0' && s[i]<='9') || (s[i]>='A' && s[i]<='Z')) {
for (j=i+1; j<strlen(s)+1; j++)
s[j-1] = s[j];
} else {
i = i + 1;
}
}
return;
}
</code>
<code>#include<stdio.h>
void f (char *);
int main(void) {
char *s = "This 12345 Is A String 678";
char *d;
d = strdup (s);
f (d);
fprintf (stdout, "%s", d);
return (1);
}
void f (char *s) {
int i, j;
i = 0;
while (i < strlen(s)) {
if (s[i]==' ' || (s[i]>='0' && s[i]<='9') || (s[i]>='A' && s[i]<='Z')) {
for (j=i+1; j<strlen(s)+1; j++)
s[j-1] = s[j];
} else {
i = i + 1;
}
}
return;
}
</code>
#include<stdio.h>
void f (char *);
int main(void) {
char *s = "This 12345 Is A String 678";
char *d;
d = strdup (s);
f (d);
fprintf (stdout, "%s", d);
return (1);
}
void f (char *s) {
int i, j;
i = 0;
while (i < strlen(s)) {
if (s[i]==' ' || (s[i]>='0' && s[i]<='9') || (s[i]>='A' && s[i]<='Z')) {
for (j=i+1; j<strlen(s)+1; j++)
s[j-1] = s[j];
} else {
i = i + 1;
}
}
return;
}