Saturday, August 18, 2018

CYCLIC NUMBER

  • Problem Description

    Write a C program to swap elements in cyclic order using call by reference.
  • CODING ARENA::
  • #include <stdio.h>
    int main()
    {
      int a,b,c;
      scanf("%d%d%d",&a,&b,&c);
      printf("%d",c);
      printf("\n%d",a);
      printf("\n%d",b);

    return 0;
    }
  • Test Case 1

    Input (stdin)
    1 2 3
    
    
    Expected Output
    3
    
    1
    
    2
  • Test Case 2

    Input (stdin)
    2 5 6
    
    
    Expected Output
    6
    
    2
    
    5

No comments:

Post a Comment