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


Please Help Members By Posting Answers For Below Questions

What is a static function in c?

845


largest Of three Number using without if condition?

1267


How do you define structure?

795


What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

963


Explain the difference between #include "..." And #include <...> In c?

797


How important is structure in life?

798


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

846


When is the “void” keyword used in a function?

1149


What is difference between stdio h and conio h?

1101


What are the similarities between c and c++?

804


Explain how do you sort filenames in a directory?

808


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

1809


Explain why C language is procedural?

980


What is a protocol in c?

753


What are the types of operators in c?

804