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

Differentiate between the expression “++a” and “a++”?

697


Why is sizeof () an operator and not a function?

577


What is maximum size of array in c?

582


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1066


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

743






What is an auto keyword in c?

640


explain what are pointers?

615


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

1697


What are identifiers and keywords in c?

564


What is a dynamic array in c?

589


Can we increase size of array in c?

534


When should we use pointers in a c program?

626


Give differences between - new and malloc() , delete and free() ?

605


What are shell structures used for?

595


Explain what are preprocessor directives?

623