WRITE A PROGRAM TO FIND A REVERSE OF TWO NO

Answer Posted / bhavesh kashikar

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a;
float rem=0,rev=0;
while(rev>=0)
{
rem=a%10;
rev=rev*10+rem;
a=a/10;
}
printf(Reverse of two digit no is:=%d",rev);
getch();
}

Is This Answer Correct ?    13 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between a string and an array?

640


What is unsigned int in c?

562


Why n++ execute faster than n+1 ?

1853


Write a c program to demonstrate character and string constants?

1687


I need testPalindrome and removeSpace #include #define SIZE 256 /* function prototype */ /* test if the chars in the range of [left, right] of array is a palindrome */ int testPalindrome( char array[], int left, int right ); /* remove the space in the src array and copy it over to the "copy" array */ /* set the number of chars in the "copy" array to the location that cnt points t */ void removeSpace(char src[], char copy[], int *cnt); int main( void ) { char c; /* temporarily holds keyboard input */ char string[ SIZE ]; /* original string */ char copy[ SIZE ]; /* copy of string without spaces */ int count = 0; /* length of string */ int copyCount; /* length of copy */ printf( "Enter a sentence:\n" ); /* get sentence to test from user */ while ( ( c = getchar() ) != '\n' && count < SIZE ) { string[ count++ ] = c; } /* end while */ string[ count ] = '\0'; /* terminate string */ /* make a copy of string without spaces */ removeSpace(string, copy, ©Count); /* print whether or not the sentence is a palindrome */ if ( testPalindrome( copy, 0, copyCount - 1 ) ) { printf( "\"%s\" is a palindrome\n", string ); } /* end if */ else { printf( "\"%s\" is not a palindrome\n", string ); } /* end else */ return 0; /* indicate successful termination */ } /* end main */ void removeSpace(char src[], char copy[], int *cnt) { } int testPalindrome( char array[], int left, int right ) { }

2217






What is use of integral promotions in c?

668


Tell me what is null pointer in c?

617


Explain logical errors? Compare with syntax errors.

633


Is there sort function in c?

581


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

631


Is there a way to switch on strings?

623


What is derived datatype in c?

639


What is the difference between exit() and _exit() function?

610


What are the 5 organizational structures?

571


Why isn't any of this standardized in c? Any real program has to do some of these things.

628