programming practice exercises

int ReverseString(char *); main() { char *Str; printf(“enter any stringn”); gets(Str); ReverseString(Str); getch(); } int ReverseString(char *rev) { if(*rev!=’’) { ReverseString(rev + 1); putchar(*rev); } return 1; }   non recursion void ReverseString( char* str, int len ) { while( len > 1 ) { swap( &str[0], &str[len – 1] ); ++str; len -= 2; […]

Read More

3 Producers and 2 Consumers Problem using PThread in C Language on Linux System

2. prodConM This is a  second version of the program. In this version, there are 3 producers and 2 consumers. The producers have to compete with each other, as well as with consumers. When two or more producers are waiting to dump their produce into the buffer, the products must be inserted into the main […]

Read More

One consumer and one producer problem using PThreads in C Programming Language.

1. ProdCon This is a program about the producer and consumer problem. Where a producer will produce and a  consumer will consume but the two of them can not access the buffer content at the same time. This is concurrence programming using threads in c language. The producer and consumer threads are given randomly generated […]

Read More