#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

Is c procedural or functional?

0 Answers  


What is 1f in c?

0 Answers  


What do you mean by recursion in c?

0 Answers  


Write a C program to get the desired output. 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 . . . 1 n..............n 1 Note: n is a positive integer entered by the user.

4 Answers  


What is a struct c#?

0 Answers  


What is a stream water?

0 Answers  


What is the output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }

8 Answers   MindFire, TCS, Tech Mahindra,


plz answer....A program that takes 3 variables e.g a,b,c in as seperate parameters and rotates the values stored so that value goes a to b, b to c and c to a .

3 Answers  


Is c dynamically typed?

0 Answers  


what does " calloc" do?

7 Answers   Cadence, Logos,


name the language for writing c compiler?

3 Answers   Microsoft,


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

0 Answers   TISL,


Categories