employer cover photo
employer logo
employer logo

Mindfire Solutions

Is this your company?

Mindfire Solutions Interview Question

program for passing number string when multiple no is print and when there are some char then it's show the output "string_error" ex - input 111222333445 output 33321

Interview Answer

Anonymous

Oct 20, 2017

#include void main() { char arr[20], i, j, count; printf("\nEnter a string: "); gets(arr); for(i=0; arr[i]!='\0'; i+=count) { count = 1; for(j=i+1; arr[j] == arr[i]; j++) { count++; } printf("%d", count); } }

1