void main()
{ int a=2,b=5;
b=a+b;
a=b-a;
b=b-a;
getch();
}
There are three primary algorithms to exchange the values of two variables. Exchange with Temporary Variable temp = a; a = b; b = temp; Exchange Without Temporary Variable Using Exclusive Or a = a ^ b; b = b ^ a; a = a ^ b; Exchange Without Temporary Variable Using Arithmetic a = a + b; b = b - a; a = a - b;
Assuming the numbers are in unsorted order, assign the first number to a temporary variable then traverse the remaining numbers, comparing each of their values to the temporary. If any value is smaller than the temporary, assign its value to the temporary. Once all values have been traversed and compared, the temporary variable holds the lowest value.
Compare the first two numbers with the ternary operator. Store the result in a temporary variable. Compare the temporary variable with the third number, again using the ternary operator.
stdarg.h
Create a static member variable to contain the count. This variable is common to all instances of the class.Initialize that variable to zero at the beginning of the program.In the class constructor, increment the variable.In the class destructor, decrement the variable.
A loop control variable is widly known as a "counter".
A "do while....." statement is a looping instruction to a program to repeat a stage in the program while some condition is true - e.g while a variable is negative, or, while one variable is less than another. A "do for ....." statement is a looping instruction to a program to repeat a stage in the program a set number of times - e.g for steps = 1 to 10, or, for steps = 1 to (some variable).
A flowchart for a program that accepts and displays the factorial of a number would include the following steps: Start, Input the number, Initialize a variable for the factorial, Use a loop to calculate the factorial by multiplying the variable by each integer up to the number, Output the result, and End. Pseudocode for the same program would look like this: START INPUT number factorial = 1 FOR i FROM 1 TO number DO factorial = factorial * i END FOR OUTPUT factorial END
a variable minus a number and the same variable is b-6b= -5b
the number next to a variable that multiplies the variable
A variable star is a star whose brightness as seen from Earth that fluctuates.
Just the number, for example: 7x the variable is 7. The variable is the number without the variable(x,y,z, etc.)