answersLogoWhite

0

max= a>b? a: b;

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you find out how many digits are in integer using vbscript?

num=32767 MsgBox(len(num))


Program to find reverse of given number using pointers?

#include #include void main() { int rev num=0; while(num>0) { rev num=rev num*10+num%10; num=num%10; } return rev_num; } int main(); { int num=4562; printf("reverse of number is%d",reverse digit(num)); getch(); return o; }


How do you sum a number's all digit using for loop?

Using for loop we can find sum of digits of a number. Inside the loop just perform Logic Expression 1) rem=num%10. {To find the unit place no. using remainder functon} 2) sum = sum+rem {to find the addition ie output} 3) num=num/10 {to eliminate the added digit} Just repeat these steps in the loop.


Abap Program To find Factorial of number?

report zbharath. data:num type i value 5, fac type i value 0. perform fact using num changing fac. write:/ 'factorial of',num,'is',fac. form fact. using value(f-num) type i. changing f-fact type i. f-fact=1. while f-num ge 1. f-fact=f-fact*f-num. f-num=f-num-1. endwhile. endform.


C program to find out largest and smallest in a list of given numbers using arrays?

#include <iostream> using std::cout; using std::cin; using std::endl; int main() { int max; int num; for (int counter = 0; counter<15; counter++) { cout <<"Enter a number: "; cin >> max; cout << "Enter another number: "; cin >> num; if (num > max) num = max; cout << "The largest number is " <<max; } return 0; }


What is the program in this output enter the number 5 square of 5 is 25 using the for loop statement?

num = 0 For eachRepeat = 1 To 5 num = num + 5 Next MsgBox(num)


How do you write a c program to find prime numbers between 1 to 10000 using functions?

You need two utility functions. The first determines if a given number is prime or not. The second finds the next prime after a given number. The following function can be used to determine if a given integer is prime: bool is_prime (const unsigned num) { if (num<2) return false; if (0==(num%2)) return num==2; unsigned max_factor = (unsigned) sqrt ((double) num) + 1; unsigned factor; for (factor=3; factor<max_factor; ++factor) if (0==(num%factor)) return false; return true; } The following function can be used to determine the next prime after the given integer: unsigned next_prime (unsigned num) { while (!is_prime (++num)); return num; } Now you can print a series of primes using the following: int main (void) { unsigned num=1; while (num<10000) { num = next_prime (num); printf ("%d is prime\n", num); } return 0; }


Finding cube using while loop in c?

int cube=1,num,i; for(i=1;i<=3;i++){ cube*=num; }


How to Reverse a hexadecimal number using bitwise?

main() { int num=0xABCD; printf("%x\n",num); int rev=0x0; int digit=0x0; while(num!=0x0) { digit=num%0x10; rev = rev*0x10 +digit; num=num/0x10; } printf("%x\n",rev); }


C program to find the given no is Armstrong or not using for loop?

//by rsravan12 #include<stdio.h> #include<conio.h> void main() { long int num,sum,k,temp ; clrscr(); printf("\nenter num= "); scanf("%d",&num); sum=0;num=temp; while(temp>0) { temp=temp%10; sum=sum+k*k*k; temp=temp/10; } if(num==sum) { printf("\n%d is armstrong",num); } else { printf("\n%d is not a armstrong",num); } getch(); } //hyderabad


Can you write a C program to print prime numbers from 1 to 100 using for loop?

#include<stdio.h> #include<math.h> bool is_prime(unsigned num) { unsigned max, factor; if (num<2) return false; if (!(num%2)) return num==2; max = (unsigned) sqrt((double)num) + 1.0; for (factor=3; factor<max; ++factor) if (!(num%factor)) return false; return true; } int main() { unsigned num; for (num=1; num<=100; ++num) if (is_prime(num)) printf ("%u is prime\n", num); return 0; }


Write a program for converting decimal into binary using recursion?

# include <stdio.h> void Rec_Dec_To_Bin (int num); void main () { int num; int base; printf ("Enter the decimal number to convert it binary.\n"); scanf ("%d", &num); printf ("The number in decimal is : %d\n", num); printf ("\n"); printf ("The %d in binary is : ", num); Rec_Dec_To_Bin (num); printf ("\n\n"); } void Rec_Dec_To_Bin (int num) { if (((num / 2) != 0) && (num > 1)) { Rec_Dec_To_Bin ((num / 2)); } printf ("%d", (num % 2)); }