Ok Here is a brief overview of your code. Inline comments.
#include<stdio.h>
Leave a space between #includeand <stdio.h>.
#include<conio.h>
This is a custom Windows-only title that you do not need. Do not turn it on.
#include<math.h>
#include<string.h>
Use space again when including headers.
void main(void)
Although this is legal, a signature is more common int main(int argc, char* argv[])as a signature for the main function. I would suggest that you use this signature.
{
static int sum;
? sum, ? , .
int i,x,y,z;
char string[10];
. . , , , , , .
printf("Enter a string:\n");
gets(string);
. !!! get !. . fgets , , . , - .
x=strlen(string);
x. , len. ( ) , .
for(i=0; ;i++)
{
if(string[i]=='\0')
{
break;
}
for-loop; for(i = 0; string[i]!='\0'; i++).
y=pow(10,i);
z=string[x-i+1]*y;
: , pow.
sum+=z;
}
printf("%d",sum);
Ok. , "% d\n".
getch();
. :
#ifdef _WIN32
system("pause");
#endif
, . , script . - ( Windows) script. , Windows, .
}
-, int, , return 0; .