int n; // the number you want to reverse
int rev_n = 0;
while (n > 0) {
// shift rev_n digits left
rev_n *= 10;
// put rightmost digit of n onto right of rev_n
rev_n += n % 10;
// remove rightmost digit of n
n /= 10;
}
write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)
program to extract a given word from a file
Here is a simple FORTRAN code to calculate the factorial of a given non-negative integer: program factorial implicit none integer :: n, result print *, "Enter a non-negative integer:" read *, n result = 1 if (n < 0) then print *, "Factorial is not defined for negative numbers." else do i = 1, n result = result * i end do print *, "Factorial of", n, "is", result end if end program factorial This program prompts the user for an integer, checks if it's non-negative, and then calculates the factorial using a loop.
Assuming the number is represented by a decimal integer, initialise a counter to zero, then repeatedly divide the number by 10 and until the number is zero. After each division, examine the remainder. Each time the remainder is zero, increment the counter. If the number is represented by a decimal float, repeatedly multiply by 10 until the value is an integer, then perform the previous algorithm.
To write a C++ program to display the student details using class and array of object.
write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)
reverse programe in fox pro
program to extract a given word from a file
It is your face
write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html
You write the number and then follow it with the digits in reverse order.
int bitcount (unsigned n) { int bitc= 0; while (n) { ++bitc; n = n&(n-1); } return bitc; }
Here is a simple FORTRAN code to calculate the factorial of a given non-negative integer: program factorial implicit none integer :: n, result print *, "Enter a non-negative integer:" read *, n result = 1 if (n < 0) then print *, "Factorial is not defined for negative numbers." else do i = 1, n result = result * i end do print *, "Factorial of", n, "is", result end if end program factorial This program prompts the user for an integer, checks if it's non-negative, and then calculates the factorial using a loop.
Given the prime factorization of an integer how can you determine if our integer is a perfect square?
there could be a part in it like this: int num, digit; int count [10]; do { digit = num%10; num != 10; ++count[digit]; } while (num);
It is an integer, not a fraction. But, if you want, you can write it as 63492063492064/1It is an integer, not a fraction. But, if you want, you can write it as 63492063492064/1It is an integer, not a fraction. But, if you want, you can write it as 63492063492064/1It is an integer, not a fraction. But, if you want, you can write it as 63492063492064/1
Assuming the number is represented by a decimal integer, initialise a counter to zero, then repeatedly divide the number by 10 and until the number is zero. After each division, examine the remainder. Each time the remainder is zero, increment the counter. If the number is represented by a decimal float, repeatedly multiply by 10 until the value is an integer, then perform the previous algorithm.