One of my graphics lab questions was to write a c program to animate a blooming flower and a bee (or a beetle) that comes to the flower, sit on it and fly away. The program uses graphics.h header file.
In this post we will see a c program to get a substring from a given main string from specified index to a specified index. For example, consider given a string mainstring which is equal to "cSourceCodes.blogsppot.com". Calling the function subString(mainstring,7,11) will return "Codes".
Arguments (parameters):
First - the original string
Second - The starting index (position) of substring (counting starts from zero)
Third - The end index of substring
In this post, we see a simple C program to simulate motion of a simple pendulum using graphics.h. Actually, this was a problem given in my CG lab (Computer Graphics lab). The program uses graphics.h header file. If you are using linux gcc, you have to include libgraph library. The header file graphics.h is already included in turboc or turboc++ compilers.