two variables are added answer is stored on not for third
variable how it is possible?

Answers were Sorted based on User's Feedback



two variables are added answer is stored on not for third variable how it is possible?..

Answer / mannucse

with the help of 2way mechine instuctions,its possible
ex:
strcat(s1,s2)
means s1=s1+s2,
or else
a+=b means a=a+b.

Is This Answer Correct ?    3 Yes 0 No

two variables are added answer is stored on not for third variable how it is possible?..

Answer / ruchi

#include<stdio.h>
#include<conio.h>
int main()
{
int x=10,y=15;
x = x+y;
printf("%d",x);
getch();
}

Is This Answer Correct ?    3 Yes 0 No

two variables are added answer is stored on not for third variable how it is possible?..

Answer / sujith

I am afraid i understood the question. If the question is
defined like, u need to exchange two variables without using
a temporary variable is,

a += b;
b = a - b;
a = a - b;
Another methos is ,
a ^= b ^= a ^= b;

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

Why functions are used in c?

0 Answers  


what will be the output of the following program, justify? #define TEST int TEST getdata() { static i; i+=10; return i; } main() { int k; k = getdata(); }

3 Answers  


At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with these names could be kept in that shelf as in this example: bottom of shelf ---> [AAAJKRDFDEWAAYFYYKK]-----Top of shelf. All these packets are to be loaded on cars. The cars are lined in order, so that the packet could be loaded on them. The cars are also named [A, B, C, D, E,………….]. Each Car will load the packet with the same alphabet. So, for example, car ‘A’ will load all the packets with name ‘A’. Each particular car will come at the loading point only once. The cars will come at the loading point in alphabetical order. So, car ‘B’ will come and take all the packets with name ‘B’ from the shelf, then car ‘C’ will come. No matter how deep in the shelf any packet ‘B’ is, all of the ‘B’ packets will be displaced before the ‘C’ car arrives. For that purpose, some additional shelves are provided. The packets which are after the packet B, are kept in those shelves. Any one of these shelves contains only packets, having the same name. For example, if any particular shelf is used and if a packet with name X is in it, then only the packets having names X will be kept in it. That shelf will look like [XXXXXXX]. If any shelf is used once, then it could be used again only if it is vacant. Packets from the initial shelf could be unloaded from top only. Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.

0 Answers   Infosys,


Describe the order of precedence with regards to operators in C.

0 Answers  


What are the different types of control structures?

0 Answers  






What does *p++ do?

0 Answers  


int far *near * p; means

0 Answers   Honeywell,


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

0 Answers  


how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.

2 Answers  


Is main is a keyword in c?

0 Answers  


can we initialize all the members of union?

2 Answers  


What does %p mean c?

0 Answers  


Categories