how to swap four numbers without using fifth variable?
Answer Posted / rocky
#include<stdio.h>
void main()
{
int a,b,c,d;
printf("enter values
");
scanf("%d %d %d %d",&a,&b,&c,&d);
printf("before swapping
");
printf("%d %d %d %d",a,b,c,d);
a=(a+d);
d=(a-d);
a=(a-d);
c=(c+b);
b=(c-b);
c=(c-b);
printf("after swapping:%d %d %d %d",a,b,c,d);
}
| Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
Explain what is the general form of a c program?
What is difference between structure and union in c?
What is static function in c?
What are enumerated types?
Is c call by value?
What is NULL pointer?
I have a varargs function which accepts a float parameter?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What is array within structure?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
What is structure data type in c?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
ATM machine and railway reservation class/object diagram