0

Plz help me in Swaping two numbers using pointer # without any third variable

How to swap two numbers using pointer and without using third variable .

5th Jun 2020, 4:19 AM
Anjali Singh
Anjali Singh - avatar
7 odpowiedzi
5th Jun 2020, 4:26 AM
uday kiran
uday kiran - avatar
+ 2
I got my mistake , thanks to every one... 🤗
5th Jun 2020, 6:08 AM
Anjali Singh
Anjali Singh - avatar
0
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 This code has error #include <stdio.h> int main() { int num1,num2,*ptr1 = NULL,*ptr2 = NULL; *ptr1 = &num1 ; *ptr2 = &num2 ; printf("Enter two number: "); scanf("%d %d", &num1,&num2); printf("%d", num1,num2); printf("num1 = %d num2 = %d", *ptr1 ,*ptr2 ); return 0; }
5th Jun 2020, 4:37 AM
Anjali Singh
Anjali Singh - avatar
0
Can anyone tell me that what is the mistake in above code
5th Jun 2020, 4:42 AM
Anjali Singh
Anjali Singh - avatar
0
uday kiran Thanks
5th Jun 2020, 4:43 AM
Anjali Singh
Anjali Singh - avatar
5th Jun 2020, 6:07 AM
Anjali Singh
Anjali Singh - avatar