Monday, July 27, 2009

In C lang. get two values for 1 var and print it(only 1 var must be used)(no arrays)?

a "C" program must get a variable 'a' two times eg:a=100;a=200;It must print the output in the order 200,100. How is this possible without getting a second variable b.(must use only one variabe,get it two times and print them in the order -second value,first value without using a second variable.)(should'nt use array)

In C lang. get two values for 1 var and print it(only 1 var must be used)(no arrays)?
use call by value? If you don't consider that as another variable





main() {


a = get value from command line;


getSecondValue(a);


print a;


}





void getSecondValue(a) {


a = get second value from command line;


print a;


}





otherwise you have to manipulate the bits of the variable, set the first half to 100 and second half to 200.

flower seeds

No comments:

Post a Comment