How many ways are there to swap two numbers without using
temporary variable? Give the each logic.
Answer Posted / chandan doki
void main()
{
int a,b;
printf("eneter any two values for a and b");
scanf("%d%d",&a,&b);
b=a+b;
a=b-a;
b=b-a;
printf("a=%d\nb=%d",a,b);
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
Can we add pointers together?
How important is structure in life?
Which is better oop or procedural?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
Is Exception handling possible in c language?
How do I use void main?
What is the c language function prototype?
How do shell structures work?
int far *near * p; means
What is memcpy() function?
What does return 1 means in c?
Sir i need notes for structure,functions,pointers in c language can you help me please
What does a function declared as pascal do differently?
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.