wat are the two methods for swapping two numbers without
using temp variable??
Answers were Sorted based on User's Feedback
Answer / vijayakumar kanagasabai
main()
{
int a=4;b=6;
printf("Before swapping: a=%d, b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("After swapping: a=%d, b=%d",a,b);
}
| Is This Answer Correct ? | 11 Yes | 1 No |
Answer / saida
int a=4,b=6;
printf("Before swapping: a=%d, b=%d",a,b);
a=a^b;
b=a^b;
a=a^b;
printf("After swapping: a=%d, b=%d",a,b);
}
| Is This Answer Correct ? | 2 Yes | 0 No |
main() { int age; float ht; printf("Enter height and age"); scanf("%d%d",&height,&age); if((age<=20)&&(ht>=5)) {printf("She loves you");} else {printf("She loves you");} }
Explain the advantages and disadvantages of macros.
What is wrong in this statement? scanf(“%d”,whatnumber);
Explain main function in c?
How does struct work in c?
write a program wch produces its own source code aas its output?
what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else printf("fail"); }
What does sizeof function do?
What are high level languages like C and FORTRAN also known as?
what is the output of the following program? main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }
Explain how do you use a pointer to a function?
Can you add pointers together? Why would you?