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 a static function in c?
largest Of three Number using without if condition?
How do you define structure?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
Explain the difference between #include "..." And #include <...> In c?
How important is structure in life?
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
When is the “void” keyword used in a function?
What is difference between stdio h and conio h?
What are the similarities between c and c++?
Explain how do you sort filenames in a directory?
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
Explain why C language is procedural?
What is a protocol in c?
What are the types of operators in c?