Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Using encryption function, f(p)=p+3; find secret number produced from a given integer N
- #include<stdio.h>
- #include<stdlib.h>
- int main(){
- int p[30], num, N, b, count=0, i;
- scanf("%d", &N);
- b=N;
- while(b!=0){
- count++;
- b/=10;
- }
- for(i=0;i<count;i++){
- p[i]=N%10;
- N/=10;
- }
- printf("Output:");
- for(i=count-1;i>=0;i--){
- p[i]=p[i]+3;
- printf("%d", p[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement