The code I've written is not producing any output. It just takes the string as an input:
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main() {
char str[100];
int i,size,s,pos;
scanf("%s", &str);
size=strlen(str);
for(i=0;i<size;i++) {
if((str[i]>=65 && str[i]<=90) || (str[i]>=97 && str[i]<=122)) {
i++;
} else {
if(str[i]>='0' && str[i]<='9') {
for(s=0;s<str[i];s++) {
printf("%s", str[i-1]);
}
}
i++;
}
}
}
for(s=0;s<str[i];s++)
loops up to the code of your number character, not what you want. you meanfor(s=0;s<str[i]-'0';s++)
here. Probably MANY other errors. – user2371524printf("%s", str[i-1]);
: type ofstr[i-1]
ischar
. But%s
ofprintf
requireschar *
– BLUEPIXYconio.h
about? This isn't standard C and is not needed here at all! – user2371524