a C prog to swap 2 no.s without using variables just an
array?
Answer Posted / 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 |
Post New Answer View All Answers
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
What does. int *x[](); means ?
Explain how can I right-justify a string?
Explain a pre-processor and its advantages.
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
What is a pointer variable in c language?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What does sizeof function do?
Why is struct padding needed?
What extern c means?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What is class and object in c?
Which is better malloc or calloc?
What is the use of linkage in c language?