#include <stdio.h>
#include<conio.h>
void main ()
{
int a,r,n,sum=0;
clrscr();
printf("enter the number");
scanf("%d",& n);
c=n
while (n!=0)
{
a=n%10;
n=n/10;
sum=sum*a+a
}
printf("the reverse is %d \n",sum);
if(c==sum)
printf("\n the given number is palindrome");
else
printf("\n the given number is not a palindrome");
getch();
}
To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.
Active Time spent online
echo "Program to check even or odd number"echo "Enter a number"read na=`expr $n % 2`if [ $a -eq 0 ] ; then #Semicolon is most important for Executing ifelse statementsecho "It is an even number"elseecho "It is an odd number"fi
;Program to check whether the value in register is even or odd .ORIG X3000 AND R2,R1,X0001 BRZ EVEN LEA R0,DEF ;PRINTS ODD IF VALUE IN REGISTER R2 IS 1 PUTS HALT EVEN: LEA R0,ABC ;PRINTS EVEN IF VALUE IN R2 IS 0 PUTS HALT ABC .STRINGZ "EVEN" DEF .STRINGZ "ODD" .END
I assume you mean is an if the number is an integer multiple of 3i am unfamiliar with C but the theory would be,find if a is integer multiple of 3b=a/3b==round(b).if 1 "yes"else "no"this is an inefficiency way but will get the job done
write a c++program by using if statement to read a number and check whether it is positive or negative
To check if a number is a palindrome, reverse the number and see if it is equal to the original number. If so, the number is a palindrome, otherwise it is not. To reverse a number, use the following function: int reverse(int num, int base=10) { int reverse=0; while( num ) { reverse*=base; reverse+=num%base; num/=base; } return(reverse); }
write a program in C to check whether a given number is apalindrome or not
8086 assembly language program to check wether given number is perfect or not
Going through a program on paper to check whether it has errors.
45
To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.
The program is here guys.......... //Finding whether the given number is perfect or not //Starts here #include<stdio.h> void main() { int i=1,temp=0,number; scanf("%d",&number); while(i<=number/2){ if(number%i==0) temp+=i; i++; } if(temp==number) printf("Its a perfect number"); else printf("Its not a perfect number"); } //ends here
virtual chase website offers a reverse number check, There price is the first 10 free and then 5.00 for 25 numbers. I have it here once and to be honest i did find out who called with just the easy method of putting there phone number in and found them with in 5 seconds.Great idea this reverse phone number check.
if it's square root is an integer, it is a square number.
echo "enter the number" if [ $# -ne 1 ] then echo "Usage: $0 number" echo " I will find reverse of given number" echo " For eg. $0 12321, I will print 12321" exit 1 fi n=$1 rev=0 sd=0 while [ $n -gt 0 ] do sd=`expr $n % 10` rev=`expr $rev \* 10 + $sd` n=`expr $n / 10` done echo "Reverse number is $rev"
unsigned reverse (unsigned n) { unsigned r = 0; while (n) { r *= 10; r += (n%10); n /= 10; } return r; } bool is_palindrome (unsigned n) { return n == reverse (n); } int main () { unsigned num; printf ("Enter a number: "); scanf ("%d", num); if (is_palindrome (num)) printf ("%d is a palindrome\n"); else printf ("%d is not a palindrome\n"); return 0; }