Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int i,j;
- char ibr[40];
- gets(ibr);
- int l=strlen(ibr);
- for(i=l-1 ; i>=0; i--)
- {
- if(ibr[i]=='1')
- break;
- }
- for(j=i-1; j>=0 ; j--)
- {
- if(ibr[j]=='1')
- ibr[j]='0';
- else
- ibr[j]='1';
- }
- printf("%s",ibr);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement