Write a program to interchange two variables without using
the third variable?
Answer Posted / genius
#include <stdio.h>
#include <conio.h>
main()
{
int a,b,temp;
clrscr();
printf("enter two numbers:");
scanf("%d,%d",&a,&b);
printf("values of a and b are %d,%d \n",a,b);
temp=a;
a=b;
b=temp;
printf("swapped values of a and b are %d,%d", a,b);
getch();
}
Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
The difference between printf and fprintf is ?
What is substring in c?
What does != Mean in c?
What are near, far and huge pointers?
Write a program to print fibonacci series without using recursion?
Write a C program to count the number of email on text
Is there anything like an ifdef for typedefs?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
What is the difference between array and structure in c?
Explain what are header files and explain what are its uses in c programming?
Write a program to show the change in position of a cursor using c
What is nested structure with example?
What is far pointer in c?
There seem to be a few missing operators ..
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }