Advertisement
Istanvir389

1's Compliments

Oct 18th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int i;
  5.     char ibr[40];
  6.     gets(ibr);
  7.     int l=strlen(ibr);
  8.    for(i=l-1; i>=0 ; i--)
  9.    {
  10.        if(ibr[i]=='1')
  11.         ibr[i]='0';
  12.      else  if(ibr[i]=='0')
  13.             ibr[i]='1';
  14.    }
  15.    printf("%s",ibr);
  16.    return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement