a C prog to swap 2 no.s without using variables just an
array?
Answers were Sorted based on User's Feedback
Answer / laxmi bose
#include<stdio.h>
main()
{
int a[0],a[1],a[2];
scanf("%d%d",&a[0],&a[1]);
a[2]=a[0];
a[0]=a[1];
a[1]=a[2];
printf("%d,%d",a[0],a[1]);
}
Is This Answer Correct ? | 11 Yes | 0 No |
Answer / sankar kiran
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter the number:");
scanf("%d%d",&a,&b)
a=a+b;
b=a-b;
a=a-b;
printf("%d%d",a,b);
getch();
}
Is This Answer Correct ? | 14 Yes | 7 No |
Answer / jaspreet singh
void main()
{
int a[2]={20,10};
a[0]=a[0]^a[1];
a[1]=a[0]^a[1];
a[0]=a[0]^a[1];
printf("a=%d,b=%d",a[0],a[1])
getch();
}
Is This Answer Correct ? | 7 Yes | 4 No |
Answer / karthik
void main()
{
int a=10,b=20;
a^=b^=a^=b;
printf("a=%d,b=%d",a,b)
getch();
}
Is This Answer Correct ? | 8 Yes | 6 No |
Answer / baidyanath bisoyi
void main()
{
int a,b;
printf("enter the two numbers\n");
scanf("%d%d",&a,&b);
printf("a=%d\n b=%d\n",a,b);
a=a+b-(b=a);
printf("a=%d\n b=%d\n",a,b);
getch();
}
Is This Answer Correct ? | 4 Yes | 3 No |
can we print any string in c language without using semicolon(;)(terminator) in whole program.
Why c++ is called c++ and not c+?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
What is Full Form of C and Why We use C
What is the difference between typedef struct and struct?
Why c is called top down?
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
Write a program to print factorial of given number using recursion?
write a progrmm in c language take user interface generate table using for loop?
What's the difference between a linked list and an array?
4. main() { int c=- -2; printf("c=%d",c); }