Saturday, September 7, 2019

Swap two no.using third variable

#include <stdio.h>
main()
{
int n1,n2,temp;
printf("enter the no.1\n");
scanf("%d",&n1);
printf("enter the no.2\n");
scanf("%d",&n2);
temp=n1;
n1=n2;
n2=temp;
printf("after swaping no.1 is %d\n",n1);
printf("after swaping no.2 is %d",n2);
}



No comments:

Implement stsStr Leetcode solution

  28.   Implement strStr() Easy Implement  strStr() . Given two strings  needle  and  haystack , return the index of the first occurrence of...