Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
finding 3 ones in a row
//gcc 5.4.0 #include <stdio.h> int main(void) { int temp = 0; int counter = 0; unsigned int x = 1011101101; while (x != 0) { temp = x % 10; x /= 10; if (temp == 1 && counter != 3) { counter++; } else if (temp == 0) { counter = 0; } if (counter == 3) { printf("returning 1"); return 1; } } printf("returning 0"); return 0; }
run
|
edit
|
history
|
help
0
NOT a String in C
main.c
co_assign1_ques_4
-Wall
pointer1
22nd HW Switchv0.1
int_A_1a.c
variable number of arguments 3
Project v0.12
Sunday assignment calculator