What is wrong with this code such that it doesnt produce
the input reversed?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
char Space = ' ';
char LineOfText;
float count;
LineOfText = getchar();
while ((LineOfText = getchar()) != '/n');
{
count = strlen(LineOfText) - 1;
while (count >= 0)
{
putchar(LineOfText[count]);
count--;
}
}
getchar();
return 0;
}
Answer Posted / ashok kumar
Actually the function strlen() returns an integer value,
but here we want to try to push that value to the float
variable. To rectify this problem declare the variable
"count" as int.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
What is sizeof c?
What is #define used for in c?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
Is c high or low level?
Explain what is the difference between text files and binary files?
Explain threaded binary trees?
Why is struct padding needed?
Where define directive used?
Is a house a mass structure?
How can I insert or delete a line (or record) in the middle of a file?
What is the explanation for prototype function in c?
What is #include stdio h and #include conio h?
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.