Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using a sample If statement program and it is showing me error.

Please let me know how to fix this.

Also suggest me a best website to learn C programming. I am a beginner...!

#include<stdio.h>
main()
{
    int a=15, b=20;
    if (b & gt; a){
        printf("b is greater");
    }
}


What I have tried:

I tried nothing I written the program as it is given on W3 website.
Posted
Updated 4-Sep-18 9:13am
v2
Comments
gschahal 10-Sep-18 12:28pm    
I tried the below program but it is showing no output.

#include<stdio.h>
main()
{
int a=15, b=20;
if (b < a)
{
printf("b is greater\n");
}
}

1 solution

in the if braces you cant use all of these operators.
C++
if( a & b ) 
is possible, or
C++
if( a < b )
but NOT both. Here is some good tutorial for Learning C++.
 
Share this answer
 
Comments
gschahal 4-Sep-18 12:45pm    
I went to the link you suggested. But that is for C++. I need a website which can help me learning C.
Eric Lynch 4-Sep-18 20:59pm    
How about this one?
https://www.learn-c.org/
KarstenK 5-Sep-18 4:12am    
The basics are the same, installing, the debugger and primitive data types. ,-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900