The following function will return the GCD or LCM of two arguments (x and y) depending on the value of the fct argument (GCD or LCM).
enum FUNC {GCD, LCM};
int gcd_or_lcm(FUNC fct, int x, int y) {
int result = 0;
switch (fct) {
case (GCD): result = gcd (x, y); break;
case (LCM): result = lcm (x, y); break;
}
return result;
}
This question is not a question. You are supposed to do your homework yourself.
12
using break; statement
write a c++ program to convert binary number to decimal number by using while statement
This is not a question.
A = 5do{statement;A = A + 1;} while (A < 10)
12
using break; statement
write a c++ program to convert binary number to decimal number by using while statement
program to find maximum of two numbers using pointers
write a c++program by using if statement to read a number and check whether it is positive or negative
This is not a question.
A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.
N = x If y < N then N = Y If z < N then N = z Print N
A = 5do{statement;A = A + 1;} while (A < 10)
There is no gotoxy statement in C.
It is very easy. The program begins here..... /*Program to sum and print numbers without creating variables*/ #include<stdio.h> main() { clrscr(); printf("%d+%d=%d",5,2,5+2); getch(); } /*Program ends here*/ Now just by changing the numbers in the "printf" statement we can add, subtract, multiply and divide the numbers without using variables. Hence the problem is solved..........
To write a C++ program to display the student details using class and array of object.