write a program to swap Two numbers without using temp variable.
Answer Posted / prudhvi
int a, b, c;
a = int.Parse(Console.ReadLine());
b = int.Parse(Console.ReadLine());
c = b;
b = a;
a = c;
Console.WriteLine("a={0},b={1}",a,b);
Console.ReadLine();
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What is stack in c?
When can you use a pointer with a function?
How many types of sorting are there in c?
can we change the default calling convention in c if yes than how.........?
What is c variable?
The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.
what is the difference between class and unio?
Are the variables argc and argv are local to main?
what is a constant pointer in C
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
What is the Purpose of 'extern' keyword in a function declaration?
What does nil mean in c?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
What is include directive in c?
Define recursion in c.