Search:

Type: Posts; User: Babkockdood

Search: Search took 0.01 seconds.

  1. Replies
    18
    Views
    37,308

    Yeah, I realized that. Look at the edit.

    Yeah, I realized that. Look at the edit.
  2. Replies
    18
    Views
    37,308

    You can put as many statements as you want on one...

    You can put as many statements as you want on one line.


    if (!argv[1]) printf("There are no arguments.\n"); return 1;
    else printf("There is at least one argument.\n"); return 0;


    EDIT: Ah,...
  3. Replies
    18
    Views
    37,308

    #include int main() { int x =...

    #include <stdio.h>

    int main() {
    int x = 8, y;
    printf("Enter the magic number: ");
    scanf("%d", &y);
    if (y == x) printf("Correct.\n");
    else printf("Incorrect.\n");
    ...
  4. Replies
    18
    Views
    37,308

    I've always preferred if-else over switch-case....

    I've always preferred if-else over switch-case. Mostly because it's easier to read and more compact.
Results 1 to 4 of 4