Posts

Showing posts from March, 2018

Happy Number

Image
Guys , I'm back with a new program and it is also in C language.  So get ready to find your lucky number now..😃 Happy Number..           Doesn't it seem interesting.. 😉           Yeah off course it is..!            What is a happy number. If the repeated sum of digits of  any number is ' 1 ', then it is considered to be a happy.. And if it is not then it is sad number.           Also when the sum of  digits of a number becomes 4..we cannot get '1' as a result because it requires so many iterations and we remain messed up into an infinite loop.., so if sum of digits is 4 then it is also a sad number.            Let's take an example.Suppose we have a number 19.  19 -> 1 and 9  1^2 + 9^2 = 82 again, 82 -> 8 and 2 8^2 + 2^2 = 68 again, 68-> 6 and 8 6^2 + 8 ^2 = 10...

Traffic Signal Simulator in C graphics

Image
Hey Guys..              I'm back with a new program and guess what? It's also in C .            I have built a program of Traffic Signal Simulator using Graphics. It simply shows a simulation of traffic signal like red,yellow and green lights lighting after regular intervals. Here you go ---> #include<conio.h> #include<graphics.h> #include<stdlib.h> #include<dos.h> int main() { int gd,gm,midx,midy; detectgraph(&gd,&gm); initgraph(&gd,&gm,"c:\\turboc3\\bgi");//initialize graphics midx=getmaxx()/2;//midpoint of x axis // midy=getmaxy()/2;midpoint of y axis settextstyle(0,HORIZ_DIR,2); outtextxy(150,50,"TRAFFIC SIGNAL SIMULATOR"); setcolor(WHITE); rectangle(midx-40,100,midx+40,320); rectangle(midx-15,320,midx+15,480); floodfill(midx-14,321,WHITE); circle(midx,140,30); circle(midx,210,30); circle(midx,280,30); w...

Let's begin with beginning..Shortest path program in c Graphics

Image
Helloow friends..     We all think, graphics in c is quite complicated.. but only in the beginning .Once you have kept your hands on it..practice more and more and graphics will be your cup of tea..  Here's a program for finding shortest route among cities using graphics:          I keep posting such interesting new programs.. Follow our blog for more. #include<graphics.h> #include<conio.h> #include<stdio.h> #include<string.h>  void        dennix(); void denmia(); void denaus(); void        miaatl(); void ausmia(); void ausatl(); void auston(); void auschi(); void phoaus(); void bosatl(); void bostle(); void boschi(); void phochi(); void chitle(); void          atlsea(); void citynode(int x,int y) { setcolor(WHITE); circle(x,y,5); setfillstyle(SOLID_FILL,GREEN); floodfill(x...