![]() |
| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| CN Owner | Like many other languages C has an if statement and it is pretty easy to grasp the concept. The if statement in C is very similar to the one you may have seen if you code PHP. Ok lets start we will create a little application to ask for a name and compare it. Start your C application by adding stdio.h and create your main function Code:
#include <stdio.h>
int main() {
}
Code: char name[1024]; Code: printf("Hello, Please enter your name blow!\n");
scanf("%s", name);
The if Statement looks like this Code: if(name == "Affix") {
//ENTER THE TRUE FUNCTION
} else {
//ENTER THE FALSE FUNCTION
}
Code: if(name == "Affix") {
printf("%s, You Fucking Rock\n", name);
} else {
printf("%s, You Suck\n", name);
}
__________________ |
| | |