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
Differentiate between the expression “++a” and “a++”?
Why is sizeof () an operator and not a function?
What is maximum size of array in c?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
What is an auto keyword in c?
explain what are pointers?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
What are identifiers and keywords in c?
What is a dynamic array in c?
Can we increase size of array in c?
When should we use pointers in a c program?
Give differences between - new and malloc() , delete and free() ?
What are shell structures used for?
Explain what are preprocessor directives?