i dont have idea what string function must be used to find consecutive characters . example is the word commit it will output the letter m . tnx for th help :D
Because you can use a simple for loop , if/else statement and a counter to output the consecutive character
Though if (any) String Function is required at all you can use strcmp on each index(a letter) and the index after that(next letter) to know if it is consecutive though it is inefficient.
Because you can use a simple for loop , if/else statement and a counter to output the consecutive character
Though if (any) String Function is required at all you can use strcmp on each index(a letter) and the index after that(next letter) to know if it is consecutive though it is inefficient.
Note that your going to find a way to get each letter according to its index and use a for loop and if else statement along with strcmp to find a consecutive letter.
Why are there so many worthless posts here? The answer is extremely simple:
There is no function (why would there be?)
Use = on 2 consecutive characters.
Here's the answer plus it has a string function
We don't give answers here. We help them fix their attempt.
As for your code: main(){ -- main is always an intscanf("%s",string); -- see thisfor(i=0;i<strlen(string);i++) -- why calculate the length of the string every time through the loop? That's a waste of resources. And why compare the last character with the \0 at the end? if(string[i]==string[i+1]){ -- indent properly printf("%c\n", string[i]); -- indent properly
where's your required return statement?
Why are there so many worthless posts here? The answer is extremely simple:
There is no function (why would there be?)
Use = on 2 consecutive characters.
We don't give answers here. We help them fix their attempt.
As for your code: main(){ -- main is always an intscanf("%s",string); -- see thisfor(i=0;i<strlen(string);i++) -- why calculate the length of the string every time through the loop? That's a waste of resources. And why compare the last character with the \0 at the end? if(string[i]==string[i+1]){ -- indent properly printf("%c\n", string[i]); -- indent properly
where's your required return statement?
Sorry about that the problem seems so easy I just couldn't help myself do the code,
and yes I agree the using strlen is a waste of time but I just thought that a (any)string function a part of his requirement so I include it.
APLX is a very complete implementation of the APL programming language from MicroAPL. The company stopped producing it in 2016 and it has been taken over by Dyalog. While Dyalog ...