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 / sanjay bhosale
LineOfText is not an array of characters.
first while loop only stores '/n' in lineOfText.
We cant apply strlen on character we should pass the address of character array to it.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How will you declare an array of three function pointers where each function receives two ints and returns a float?
What is graph in c?
Can two or more operators such as and be combined in a single line of program code?
What are integer variable, floating-point variable and character variable?
Explain the difference between getch() and getche() in c?
Is null equal to 0 in sql?
What functions are in conio h?
what is different between auto and local static? why should we use local static?
What is a constant and types of constants in c?
What is an auto variable in c?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
Explain what does the function toupper() do?
What is enumerated data type in c?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.