#include <stdio.h>
#include <stdlib.h>
void reverse(FILE * file) {
int fscanf_return_value;
char x;
/* read a char */
fscanf_return_value = fscanf(file,"%c",&x) ;
if(fscanf_return_value == EOF) { //fscanf returns EOF as the END OF FILE
return;
}
reverse(file); //Get the next char
//do something with the char e.g. print
putchar(x);
return;
}
int main(int argc, char *argv[]) {
int i;
FILE *fd;
if (argc!=2) {
printf("Usage : \n %s FILENAME\n",argv[0]);
exit(0);
}
if(!(fd=fopen(argv[1],"r"))) {
printf("Opening file error\n");
exit(1);
}
reverse(fd);
printf("\n\n\t---\tenoD - Done\t---\n");
close(fd);
exit(0);
}
.....................if u like it get ask me more
my FB ID is phani.9885120096@gmail.com.
what is string
This is not a question.
wefwfe
If you don't need to preserve the first string you could just iterate over the second string and copy each character onto the end of the first string, then return that
write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)
Yes.
i am sam
what is string
Not possible through html. Use php strrev function. For eg:
This is not a question.
In python, type the following into a document. NOTE: Sentences following a # symbol are comments, and are not necessary for the program to run. #!/usr/bin/python #This program takes a input from a user and reverses it. number = input("Type a number: ") #This takes input from a user. a = len(number) #This finds the length of the number reverse = "" #This sets the variable reverse to an empty string. for i in number: a = a-1 #The places in a string start from 0. The last value will be the length minus 1.reverse = reverse + number[a] #Makes the number's last digit the new string's first. print("The reverse of", number, "is", reverse + ".") #prints the resulting string. This program will take any sequence of characters and reverse them. The final value is a string, but if an integer is needed, one needs only to add the line reverse = int(reverse) above the print statement. However, this will stop the program from being able to reverse strings, as it is not possible to convert a string to an integer if it is not a number.
Use text-editor notepad++
wefwfe
If you don't need to preserve the first string you could just iterate over the second string and copy each character onto the end of the first string, then return that
Use the tolower() function. Example: char* a = 'X'; a = tolower(a); printf("%c", a);
write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)
question clarity