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
What is the purpose of scanf() and printf() functions?
What is the purpose of the statement: strcat (S2, S1)?
How a string is stored in c?
What is difference between %d and %i in c?
Write a program to check whether a number is prime or not using c?
What is the meaning of && in c?
What is ctrl c called?
What is modifier & how many types of modifiers available in c?
What are the 32 keywords in c?
Explain how does free() know explain how much memory to release?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
What happens if header file is included twice?
pierrot's divisor program using c or c++ code
Which are low level languages?
Explain about the constants which help in debugging?