Advertisement
Nabil-Ahmed

Untitled

Jun 18th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. /*Swap Numbers Using Temporary Variable*/
  2. #include<stdio.h>
  3. int main()
  4. {
  5.     int num1;
  6.     int num2;
  7.     int temp;
  8.  
  9.     printf("Enter any two number:\n");
  10.     scanf("%d %d", &num1, &num2);
  11.  
  12.     temp=num1;
  13.     num1=num2;
  14.     num2=temp;
  15.  
  16.  
  17.     printf("num1:%d",num1);
  18.     printf("num2:%d",num2);
  19.  
  20.     return 0;
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement