Threads in MS Windows(Cont / threadsum c * int addem(int count) /* To compile: >cl threadsum.c /MT*/ nt 1. sum #include <stdio sum=0 #include <stdlib # include <process. h> for(i=1; i<=count; 1++) int addem (int) printf(" The value of i is %d\n,1); Int main( fflush(stdout) beginthread((void ()(void)addem, 0, (void *)5); sum +=1 addem(5); return 0 printf("The sum of i is %d n', sum) fflush(stdout) return 0 66 Threads in MS Windows (Cont.) int addem(int count) { int i, sum; sum = 0; for(i = 1; i <= count; i++) { printf(“The value of i is %d\n”, i); fflush(stdout); sum += i; } printf( “The sum of i is %d \n”, sum); fflush(stdout); return 0; } /* threadsum.c */ /* To compile: > cl threadsum.c /MT */ #include <stdio.h> #include <stdlib.h> #include <process.h> int addem(int); int main() { _beginthread( (void (*)(void())addem, 0, (void *)5); addem(5); return 0; }