- #1
clook
- 35
- 0
here's what i have:
won't compile.. says "compound" statement is missing at the end.
what am i doing wrong?
Code:
#include<stdio.h>
#include<string.h>
main() {
char string[32];
int sum = 0;
int a = 1;
int i;
printf("Please enter numbers:\n");
gets(string);
for (i=32;i<0;i--)
{
if(string[i] ==1)
{ sum = sum + a;
}
a = a * 2;
printf("The converted string is: %s \n", string[i]);
}
won't compile.. says "compound" statement is missing at the end.
what am i doing wrong?