Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Project 3 Part 1 v1.3
//gcc 5.4.0 #include <stdio.h> #include <stdlib.h> //Start Program //int n //int i //int f //READ n //for(i=0;i<=n;i++){ // f=(i-1)+(i-2); // printf("%d,",f); // } //End Program int main(void) { int n; int i; int f; scanf("%d",&n); if(n==0){ printf("0"); } else if(n>=2){ printf("0,"); for(i=1;i<=n;i++){ f=(i-1)+(i-2); f=abs(f); printf(" %d",f); } } else{ for(i=1;i<=n;i++){ f=(i+2)-(i+1); f=abs(f); printf(" %d",f); } } }
run
|
edit
|
history
|
help
0
Midterm practice 2
150116_MatrizOrdenada
Assignment 7
18BCE2182 ASSESS_2 Q3
Official Hello world
est
20171117_PITAGORAS
first C code
20171117_TARTAGLIA
tickeParsing.c