daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. int a[1000],n,k,X;
  6. scanf("%d",&n);
  7. printf("\n");
  8. for(k=0;k<n;k++){
  9. scanf("%d",&a[k]);
  10. }
  11. printf("\n");
  12. scanf("%d",&X);
  13. for(k=0;k<n;k++)
  14. {
  15. if(X>a[k])
  16. {
  17. printf("%d",X+a[k]);
  18. }
  19. else if(X<=a[k])
  20. {
  21. printf("%d",a[k]-X);
  22. }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top