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 are the scope of static variables?
formula to convert 2500mmh2o into m3/hr
How are portions of a program disabled in demo versions?
Can I initialize unions?
What is memcpy() function?
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.
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
How does normalization of huge pointer works?
Why do we use main function?
Explain pointer. What are function pointers in C?
Can a program have two main functions?
what will be the output for the following main() { printf("hi" "hello"); }
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?
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
What is output redirection?