You should just wrap your code inside a for loop:

#include <stdio.h>

int main() {

    int A, B;
    char Y = 'Y', N = 'N', C;

    for (;;) {     // same as while(1)
        printf("Enter value 1: ");
        if (scanf("%i", &B) != 1)
            break;
        printf("\nEnter value 2: ");
        if (scanf("%i", &A) != 1)
            break;

        printf("%i + %i = %i\n", A, B, A + B);

        printf("\n\nAdd again? Y or N\n");
        // note the initial space to skip the pending newline and other whitespace
        if (scanf(" %c", &C) != 1 || C != Y)
            break;
    }
    printf("PROGRAM USE ENDED.\n");
    return 0;
}
Answer from chqrlie on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ c language โ€บ continue-in-c
Continue Statement in C - GeeksforGeeks
If the condition is true, the program control will jump to the start of the loop and all the statements below the continue will be skipped. Steps 1 and 2 will be repeated till the end of the loop. The flowchart of the continue can be constructed using the understanding of the continue we got from above. ... #include <stdio.h> int main() { int n = 1; // Loop from 1 to 10 while (n <= 10) { // If the number is even, skip iteration to avoid printing it if (n % 2 == 0) { n++; continue; } printf("%d ", n); n++; } return 0; }
Published ย  October 17, 2025
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ cprogramming โ€บ c_continue_statement.htm
Continue Statement in C
The continue statement is used to skip the execution of the rest of the statement within the loop in the current iteration and transfer it to the next loop iteration. It can be used with all the C language loop constructs (while, do while, and for).
Discussions

c - How to insert a continue statement inside an if statement - Stack Overflow
My code is below. I am using C language. I want to repeat the action from the start if the user types Y but I am confused how can I make that happen. I tried to look for a solution but the results ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Is it possible to use continue in conditional operator? in c language - Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most. Learn more about Collectives ... Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... No it's not possible, because continue is not an expression, and all parts of a conditional operator must also be expressions. Use an if statement... More on stackoverflow.com
๐ŸŒ stackoverflow.com
December 22, 2025
Continue a if statement in C++ - Stack Overflow
Instead, you can save this post to reference later. ... By continuing to use this website, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. By exiting this window, default cookies will be accepted. More on stackoverflow.com
๐ŸŒ stackoverflow.com
July 23, 2025
Reddit - The heart of the internet
Reddit is where millions of people gather for conversations about the things they care about, in over 100,000 subreddit communities. More on reddit.com
๐ŸŒ reddit.com
6 days ago
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ cpp โ€บ c-language โ€บ continue-statement-c
continue statement (C) | Microsoft Learn
January 25, 2023 - A continue statement in a for statement causes evaluation of the loop expression of the for statement. Then the code reevaluates the conditional expression. Depending on the result, it either terminates or iterates the statement body.
๐ŸŒ
Learn C
learnc.net โ€บ home โ€บ learn c programming โ€บ c continue
An Essential Guide to C continue Statement By Examples
April 13, 2025 - The continue statement works like a shortcut to the end of the loop body. To continue statement includes the continue keyword with a semicolon (;): ... In practice, you often use the continue statement with an if statement to specify a condition for skipping the current iteration:
๐ŸŒ
Sololearn
sololearn.com โ€บ en โ€บ Discuss โ€บ 1527676 โ€บ continue-statement-in-c
Continue statement in c | Sololearn: Learn to code for FREE!
June 19, 2024 - You use it like this: if(condition) { continue; } else { // do something; } The else clause will only be executed if the condition is false, so you could shorten the whole thing to: if(!condition) { // do something; } If you really want to use ...
๐ŸŒ
Cppreference
en.cppreference.com โ€บ w โ€บ cpp โ€บ language โ€บ continue.html
continue statement - cppreference.com
June 19, 2024 - The continue statement causes a jump, as if by goto to the end of the loop body (it may only appear within the loop body of for, range-for, while, and do-while loops). ... #include <iostream> int main() { for (int i = 0; i < 10; ++i) { if (i != 5) continue; std::cout << i << ' '; // this statement ...
Find elsewhere
๐ŸŒ
Programiz
programiz.com โ€บ c-programming โ€บ c-break-continue-statement
C break and continue
Become a certified C programmer. Try Programiz PRO! ... The break statement ends the loop immediately when it is encountered. Its syntax is: ... The break statement is almost always used with if...else statement inside the loop.
๐ŸŒ
Unstop
unstop.com โ€บ home โ€บ blog โ€บ continue statement in c | working, use & more (+examples)
Continue Statement In C | Working, Use & More (+Examples)
May 28, 2024 - If the statement condition is false, meaning the value of i is even, then the if-block is skipped. And the printf() statement after that is executed, which displays the value of i. Here, the %d format specifier indicates an integer value, and the newline escape sequence (\n) shifts the cursor to the next line so that the next output is printed in a new line. As shown in the output for the example of the continue statement in C, this loop continues printing even numbers to the console, skipping odd numbers.
๐ŸŒ
BeginnersBook
beginnersbook.com โ€บ 2014 โ€บ 01 โ€บ c-continue-statement
C โ€“ continue statement with example
September 23, 2017 - When a continue statement is encountered inside a loop, control jumps to the beginning of the loop for next iteration, skipping the execution of statements inside the body of loop for the current iteration. ... #include <stdio.h> int main() { for (int j=0; j<=8; j++) { if (j==4) { /* The continue ...
๐ŸŒ
Dremendo
dremendo.com โ€บ c-programming-tutorial โ€บ c-break-and-continue-statement
break and continue Statement in C | Dremendo
In the above example, we want to exit from the loop when the value of i is equal to 10. So, we have used a break statement inside the body of if statement which executes when the given condition is true, and the loop terminates. Nested for Loop: We can also use break statement while working with nested loops.
๐ŸŒ
W3Schools
w3schools.com โ€บ c โ€บ c_break_continue.php
C Break and Continue
The break statement can also be used to jump out of a loop. ... The continue statement breaks one iteration (in the loop), if a specified condition occurs, and continues with the next iteration in the loop.
๐ŸŒ
Quora
quora.com โ€บ What-is-use-of-continue-in-an-if-block
What is use of continue; in an if block? - Quora
June 13, 2022 - When placed inside an if block, continue acts as a conditional early-exit from that iteration: if the if-condition is true, the loop jumps to its next iteration (performing any loop increment/update and re-checking the loop condition); code ...
๐ŸŒ
Oreate AI
oreateai.com โ€บ blog โ€บ using-continue-in-if-statements-in-c-language โ€บ 23f7092c3cad8ff650b47cd878eb0bbc
Using 'Continue' in if Statements in C Language - Oreate AI Blog
December 22, 2025 - Basic Usage: In an if statement, using 'continue' effectively skips any remaining code within that loop iteration. For example, consider a for loop where we need to check if a variable exceeds a certain value during each iteration.
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ continue-statement-in-c
Continue Statement in C Programming
April 2, 2025 - And we want to skip executing the second 5 lines (statement6 โ€”statement10) when a certain condition is True, or else it has to execute all the 10 lines inside the loop. In these situations, we place the condition after the 5th statement, followed by this continue statement. If the condition is True, then it will stop executing statements 6 to 10.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 74589547 โ€บ continue-a-if-statement-in-c
Continue a if statement in C++ - Stack Overflow
July 23, 2025 - Copyif (foo()) { if (!bar()) { ... } } ... Nothing to say about this question in particular but the best way to reduce indentation is to split your code into separate functions. ... Save this answer. Show activity on this post. You can replace the true-branch statement by a call to a lambda function from which you return, if you want something like that:
๐ŸŒ
GNU
gnu.org โ€บ software โ€บ c-intro-and-ref โ€บ manual โ€บ html_node โ€บ continue-Statement.html
continue Statement (GNU C Language Manual)
for (;*p; ++p) { /* Exit if we have reached a newline. */ if (*p == '\n') break; /* Pay no attention to spaces. */ if (*p != ' ') { /* Operate on the next character. */ โ€ฆ } } The advantage of using continue is that it reduces the depth of nesting. Contrast continue with the break statement.
๐ŸŒ
Sololearn
sololearn.com โ€บ en โ€บ Discuss โ€บ 2441763 โ€บ how-to-make-python-continue-after-if-statement
How to make Python continue after if statement | Sololearn: Learn to code for FREE!
August 12, 2020 - "". join["w" if c in["l", "r"] else c for c in list(message)] https://code.sololearn.com/cP8mz8YnWilg/?ref=app ... A bit late with my post, but it shows a simplified version of the code. There are 2 conditional statements to check if the desired characters are in the input string.
๐ŸŒ
Medium
medium.com โ€บ @Dev_Frank โ€บ continue-statement-in-c-a362f9cbb022
CONTINUE STATEMENT IN C. Continue statement is a powerful toolโ€ฆ | by Dev Frank | Medium
January 12, 2024 - The "continue" statement is used in programming to skip the rest of the code inside a loop and move to the next iteration. When encountered, it jumps to the next iteration(Increment / Decrement) without executing the remaining code below it ...