Q:

How to write a while statement in c?

I should write a C while statement that continues while x is both larger than 10 and a multiple of either 6 or 7.  I only need to include the actual while statement, not the entire loop!
I know it may look funny to you, but this is what I have so far.
#include<stdio.h>

int main(){
    int x;

    while (x > 10, x % 7 = 0 || x % 6 = 0) {
        printf("%d\n", x);
    }
}

A:

Logical and is &&. As an operator, , is "ignore the result of the thing to the left".

A:

Your Boolean logic and comparison both use the wrong syntax. It should be like this:
while (x > 10 && (x % 7 == 0 || x % 6 == 0)) {

The comma (,) is not a valid Boolean operator. What you wanted is && (logical AND). You need parentheses around the other two expressions because AND (&&) has higher precedence than OR (||).
And = is for setting values; == is for comparing them.
Finally, as others pointed out, you don't set x anywhere in the code that you have posted. So, your loop will not run. And you don't modify x in the loop, so, if you ever get into the loop, you will never get out.

