#include <stdio.h>
int main()
{
if ("X" <"x")
printf("X smaller than x
");
}


my question is whats the mistake in this program? find it and please tell me..

Answers were Sorted based on User's Feedback



#include <stdio.h> int main() { if ("X" <"x") printf("X sma..

Answer / sandeep

Friend
In c if we write string constants like "Hi" "Hello world"
etc,it will be just a poiinter unless u prints it.
So if pointer pointing "X" is greater "if will not be executed"
else if pointer pointing "x" is greater "if will be executed"

Is This Answer Correct ?    2 Yes 1 No

#include <stdio.h> int main() { if ("X" <"x") printf("X sma..

Answer / raisa

character X and x should always be enclosed in single quotes

Is This Answer Correct ?    0 Yes 0 No

#include <stdio.h> int main() { if ("X" <"x") printf("X sma..

Answer / preethi

#include <stdio.h>
void main()
{
int X,x;
if (X <x)
printf("X smaller than x");
}

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Interview Questions

Explain following declaration int *P(void); and int (*p)(char *a);

3 Answers  


What is storage class?

0 Answers  


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

0 Answers  


What is the function of multilevel pointer in c?

0 Answers  


What is the general form of #line preprocessor?

0 Answers  


Explain the bubble sort algorithm.

0 Answers  


Explain how does flowchart help in writing a program?

0 Answers  


Is there sort function in c?

0 Answers  


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

0 Answers  


How can you read a directory in a C program?

0 Answers  


Is there a way to compare two structure variables?

0 Answers  


what are the general concepts of c and c++

2 Answers  


Categories