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 are the scope of static variables?

850


formula to convert 2500mmh2o into m3/hr

770


How are portions of a program disabled in demo versions?

1025


Can I initialize unions?

829


What is memcpy() function?

866


I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

1726


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

1832


How does normalization of huge pointer works?

902


Why do we use main function?

917


Explain pointer. What are function pointers in C?

847


Can a program have two main functions?

869


what will be the output for the following main() { printf("hi" "hello"); }

10189


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

817


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

823


What is output redirection?

917