QBASIC operators are listed as follows.../along with some example QBASIC code... ->LOGICAL OPERATORS AND OR NOT EXAMPLE QBASIC CODE:- A=1 B=1 IF (A AND B) THEN PRINT "Result: True" ELSE PRINT "Result: False" ...output... Result: True A=1 B=2 IF (A AND B) THEN PRINT "Result: True" ELSE PRINT "Result: False" ...output... Result: False -> MATHEMATICAL OPERATORS + plus - minus * multiply / divide MOD division remainder ^ raise to the power EXAMPLE QBASIC CODE:- num1=4 num2=2 PRINT num1 + num2 PRINT num1 - num2 PRINT num1 * num2 PRINT num1 / num2 PRINT num1 MOD num2 PRINT num1 ^ num2 ...output... 6 2 8 2 0 16 -> COMPARISON OPERATORS = equals > greater than < lesser than >= greater than/or, equals <= lesser than/or, equals <> not EXAMPLE QBASIC CODE:- num1 = 6 num2 = 8 IF num1 = num2 THEN PRINT "Equal to" IF num1 > num2 THEN PRINT "Greater than" IF num1 < num2 THEN PRINT "Lesser than" IF num1 >= num2 THEN PRINT "Greater than/or, equal to" IF num1 <= num2 THEN PRINT "Lesser than/or, equal to" IF num1 <> num2 THEN PRINT "NOT equal" ...output... Lesser than Lesser than/or, equal to NOT equal
class test { public static void main(int num) { int num2=num; int rnum=0; while (num2>0) { int q=num2/10; int dig=num2%10; rnum = rnum*10+dig; num2=q; } if (rnum==num) System.out.println("Palindrome number"); else System.out.println("Not a Palindrome number"); } }
#include<stdio.h> main() { int num1; int num2; int a; printf("Enter any two numbers :"); scanf("%d%d",&num1,&num2); for(a=num1;num1<=num2;a++) { if ( a % 2 == 1); { printf("%d",a); } } getch(); }
#include<stdio.h> main() { long int num1, num2; long int sum=0; printf("Enter Value="); scanf("%ld", &num1); printf("Enter Value="); scanf("%ld", &num2); sum=num1+num2; printf("The Result is=%ld", sum); }
int num1 = 1; int num2 = 50; int addition = num1 + num2;
The default keys are the NUM2 and NUM8. But if u modified the keys inthe controller settings,then u MUST have set some keys for lifting and dropping the fork! good luck!
QBASIC operators are listed as follows.../along with some example QBASIC code... ->LOGICAL OPERATORS AND OR NOT EXAMPLE QBASIC CODE:- A=1 B=1 IF (A AND B) THEN PRINT "Result: True" ELSE PRINT "Result: False" ...output... Result: True A=1 B=2 IF (A AND B) THEN PRINT "Result: True" ELSE PRINT "Result: False" ...output... Result: False -> MATHEMATICAL OPERATORS + plus - minus * multiply / divide MOD division remainder ^ raise to the power EXAMPLE QBASIC CODE:- num1=4 num2=2 PRINT num1 + num2 PRINT num1 - num2 PRINT num1 * num2 PRINT num1 / num2 PRINT num1 MOD num2 PRINT num1 ^ num2 ...output... 6 2 8 2 0 16 -> COMPARISON OPERATORS = equals > greater than < lesser than >= greater than/or, equals <= lesser than/or, equals <> not EXAMPLE QBASIC CODE:- num1 = 6 num2 = 8 IF num1 = num2 THEN PRINT "Equal to" IF num1 > num2 THEN PRINT "Greater than" IF num1 < num2 THEN PRINT "Lesser than" IF num1 >= num2 THEN PRINT "Greater than/or, equal to" IF num1 <= num2 THEN PRINT "Lesser than/or, equal to" IF num1 <> num2 THEN PRINT "NOT equal" ...output... Lesser than Lesser than/or, equal to NOT equal
int num1 = 5; int num2 = 5; printf ("%d/%d=%d\n", num1, num2, num1/num2); and if you want to enter during the program then int num1; int num2; printf ("what is the first number?"); scanf ("%d", &num1); printf ("what is the second number?"); scanf ("%d", &num2); printf ("%d/%d=%d\n", num1, num2, num1/num2); i hope this helped
#include <stdio.h>int main(){ int num1, num2, max; printf("Enter two positive integers: "); scanf("%d %d", &num1, &num2); max=(num1>num2) ? num1 : num2; while(1) { if(max%num1==0 && max%num2==0) { printf("LCM of %d and %d is %d", num1, num2,max); break; } ++max; } return 0;}
if num1>num2 return num1 else return num2
class test { public static void main(int num) { int num2=num; int rnum=0; while (num2>0) { int q=num2/10; int dig=num2%10; rnum = rnum*10+dig; num2=q; } if (rnum==num) System.out.println("Palindrome number"); else System.out.println("Not a Palindrome number"); } }
first you make 3 integer variables. lets called them sum1, num1 and num2 then you get user imput that will assign num1 and num2 with values or make a statment giving them valvues such as num1=5 num2=3 then you make a statement that assigns sum1 a valvue, sum1=num1 + num2 Thats it.
#include<stdio.h> main() { int num1; int num2; int a; printf("Enter any two numbers :"); scanf("%d%d",&num1,&num2); for(a=num1;num1<=num2;a++) { if ( a % 2 == 1); { printf("%d",a); } } getch(); }
#include using std::cin;using std::cout;using std::endl;int main(){float num1(0.0f);cout num1;float num2(0.0f);cout num2;cout
read num1 read num2 sum = num1 num2 print highest value
int main() { int num1; int num2; int result = num1 + num2; return 0; }
#include <iostream> int main() { int num1=0, num2=0; printf( "Enter a number: " ); scanf_s( "%d", num1 ); printf( "Enter another number: " ); scanf_s( "%d", num2 ); printf( "Total is: %d\n", num1 + num2 ); return( 0 ); }