rajamit872

Encryption by using C asked in AMCAT

Sep 22nd, 2014
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include<conio.h>
  2. #include<stdio.h>
  3. void main()
  4. {
  5. clrscr();
  6. char ch[6] = {'s','a','m','p','l','e'};
  7. int a[6];
  8. int c=5;
  9. printf("Entered String Is ::");
  10. for(int i=0;i<=6;i++)
  11. printf("%c",ch[i]);
  12.  
  13. for(i=0;i<6;i++)
  14. {
  15. a[i] = ((int)ch[i])+c;
  16. c--;
  17. }
  18.  
  19. printf("\nEncrypted String is::");
  20. for(int j=0;j<6;j++)
  21. {
  22. printf("%c",a[j]);
  23. }
  24.  
  25. getch();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment