hamaXD

CPT lab02-01

Aug 28th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. void to_next(char* cptr);
  4.  
  5. int main(){
  6.   char c;
  7.   while(1){
  8.     printf("Enter: "); fflush(stdin);
  9.     scanf("%c",&c);
  10.     if(c>='a'&&c<='z'){
  11.         to_next(&c);
  12.         printf("= %c\n",c);
  13.     }else{
  14.         break;
  15.     }
  16.    
  17.  }
  18.   return 0;
  19. }
  20. void to_next(char* cptr){
  21.     //printf("\n%d\n",cptr);
  22.     //printf("%c\n",*cptr);
  23.     if(*cptr!='z'){
  24.         *cptr+=1;
  25.     }
  26.     else{
  27.         *cptr='a';
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment