About 13,300,000 results
Open links in new tab
  1. How to write a number range in c for a condition - Stack Overflow

    Aug 6, 2012 · This one could go either way as far as I care, but if you are trying to learn c then you might have served yourself better by reading up on the syntax and deducing the answer for yourself. –

  2. How can I use ranges in a switch case statement in C?

    Apr 20, 2016 · Option 1: use case 0 for 0-9, case 1 for 11-20 and so on. Option 2: use if. Option 3: Another shabby way is using fall through cases like this: int i=1; for(i=1;i<=25;i++) switch(i) case 1: case 2: case 3: case 4:

  3. Using Range in switch Case in C - GeeksforGeeks

    Dec 26, 2023 · Range in switch case can be useful when we want to run the same set of statements for a range of numbers so that we do not have to write cases separately for each value. That is the case range extension of the GNU C compiler and not standard C.

  4. C Program: How to set custom integer range, strictly limiting the ...

    Jan 29, 2013 · #include <stdint.h> uint64_t n; if(scanf("%" PRIu64, &n) == 1) { if(n >= 1 && n <= UINT64_C(10000000000)) printf("Great, number accepted\n"); else printf("Please enter a number in range 1..10000000000\n"); } else printf("Please enter a number.\n");

  5. Using range with switch case statement in C programming language

    Learn: How we can use switch case with the case values in a range in C programming language? In this article, we are going to explain the same with an example.

  6. C for Loop (With Examples) - Programiz

    In programming, loops are used to repeat a block of code. In this tutorial, you will learn to create for loop in C programming with the help of examples.

  7. C programming exercises: For Loop - w3resource

    Aug 9, 2010 · 28. Find Perfect Numbers in a Range. Write a C program to find the 'Perfect' numbers within a given number of ranges. Test Data : Input the starting range or number : 1 Input the ending range of number : 50 Expected Output: The Perfect numbers within the given range : 6 28 Click me to see the solution. 29. Armstrong Number Check

  8. C For Loop - Online Tutorials Library

    The syntax of the for loop in C programming language is −. for (init; condition; increment){ statement(s); }

  9. Range of IF statements in C programming - Stack Overflow

    Sep 14, 2014 · if (5>=hour && hour<9) { if (minute<7) { printf ("%d:00"); return 0;} else if (8<=minute && minute<22) { printf ("%d:15",hour); retu...

  10. C for Loop - GeeksforGeeks

    Dec 16, 2024 · In C programming, the for loop is used to repeatedly execute a block of code as many times as instructed. It uses a variable (loop variable) whose value is used to decide the number of repetitions.

  11. Some results have been removed
Refresh