You are on page 1of 1

#include <stdio.

h>
int main()
{
int i,n,hasil;
scanf("%d",&n);
hasil=1;
i=1;
printf("%d=",n);
while(i<=n){
{if (i % 2 !=0);}
printf("%d",i);
hasil=hasil+i;

if (i !=n){
printf (" + ");
}
else{
printf(" = ");
}
i=i+1;
}

printf("%d\n",hasil);
}

You might also like