write a program to swap Two numbers without using temp variable.
Answer Posted / rani
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf ("enter the values to a & b");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("%d%d",a,b);
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do we open a binary file in Read/Write mode in C?
What are pointers? Why are they used?
When should a type cast not be used?
Can we add pointers together?
what are the advantages of a macro over a function?
Can you return null in c?
What are qualifiers?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
Explain the difference between the local variable and global variable in c?
What is the symbol indicated the c-preprocessor?
Can you please explain the difference between malloc() and calloc() function?
What does %c do in c?
What is 2 d array in c?
What is the difference between typedef struct and struct?
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.