how to swap two nubers by using a function with pointers?
Answer / reshma
void swap(int *a, int *b)
{
int tmp;
tmp=*a;
*a=*b;
*b=tmp;
}
or
void swap(int *a, int *b)
{
*a=*a^*b;
*b=*a^*b;
*a=*a^*b;
}
Is This Answer Correct ? | 10 Yes | 1 No |
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
fun(int x) { if(x > 0) fun(x/2); printf("%d", x); } above function is called as: fun(10); what will it print? }
i want to have a program to read a string and print the frequency of each character and it should work in turbo c
What does sizeof int return?
Explain how can you tell whether two strings are the same?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300
Explain how do you determine the length of a string value that was stored in a variable?
What is the purpose of scanf() and printf() functions?
What are the primitive data types in c?
1 232 34543 4567654 can anyone tell me how to slove this c question
There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side?