#include <stdio.h>
int main()
{
int values[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, i, p=0;
for (i = 0; i <= 9; i++)
printf("%d ", values[i]);
for (i = 0; i <= 9; i++)
p += values[i];
printf("\n\nthe total of all array elements is %d", p);
return 0;
}
declare and assign values unsized (what the [] are for) array as a set of integers
program will set memory for all of them. print those integers to the screen
add array elements to get sum of values. print sum to screen.
return 0; for int main() function and then end program
I have to break c programming because of my school. I go to college and my lessons very difficult this year. When i start again c programming next year, i need start from the beginning. Before break, i wanna create password cracker or system control panel etc. Just hobbie im not hacker. Once and for all thanks for your program i checked.