reverse function in c
#include <stdio.h>
#include <string.h>
int main()
{
char s[100];
printf("Enter a string to reverse\n");
gets(s);
strrev(s);
printf("Reverse of the string: %s\n", s);
return 0;
}#include <stdio.h>
int main() {
int n, rev = 0, remainder;
printf("Enter an integer: ");
scanf("%d", &n);
while (n != 0) {
remainder = n % 10;
rev = rev * 10 + remainder;
n /= 10;
}
printf("Reversed number = %d", rev);
return 0;
}
Also in C:
- c programming print pattern pyramid
- print digits of a number in c
- intellij idea
- scanf in c
- resto de division recursiva
- print hello world in c
- amazon kinesis disaster recovery
- kadane's algorithm
- warning: function returns address of local variable [-Wreturn-local-addr]
- sbatch array set max jobs at once
- roblox metatable
- the best programming language in 2021
- sdl texture error
- fscanf stops at space
- typedef enum in c
- c program to find number of days in a month using switch case
- select all file from date powershell
- Ionic 3 camera plugin not returning video from photo library on ios
- what is the meaningof noremap
- macos prevent disk mounting
- arduino client disconnect
- unable to locate package dos2unix
- blockchain implementation
- oop244