Category: Uncategorized
-
draw tree using graphics in c++.
implementation of to draw tree using graphics in c++. program: #include <graphics.h> #include <iostream> #include <math.h> #include <sstream> using namespace std; // Function that prints Tree using // functions graphic.h header file void printTree(int x, int y, int* array, int index, int total_elements) { // Base Case if (index >= total_elements) return NULL;…
-
no errors then run your project.
program #include<Windows.h> // first include Windows.h header file which is required #include<stdio.h> #include<gl/GL.h> // GL.h header file #include<gl/GLU.h> // GLU.h header file #include<gl/glut.h> // glut.h header file from freeglut\include\GL folder #include<conio.h> #include<stdio.h> #include<math.h> #include<string.h> // Init_OpenGL() function void Init_OpenGL() { // set background color to Black glClearColor(0.0, 0.0, 0.0, 0.0); // set shade model to Flat glShadeModel(GL_FLAT); } // Display_Objects() function void Display_Objects(void) { // clearing the window or remove all drawn objects glClear(GL_COLOR_BUFFER_BIT); /*glPushMatrix(), which copies the current matrix and adds the copy to the top of the stack, and glPopMatrix(), which discards the top matrix on the stack*/ glPushMatrix(); //the glTranslatef() routine in the display list alters the position of the next object to be drawn glTranslatef(0.0, 0.0, 0.0); // set color to object glColor3f(red,green,blue); glColor3f(1.0, 0.8, 0.0); // draw a wire tea pot glutWireTeapot(1.0); // draw a wire sphere glTranslatef(-2.5, 0.0, 0.0); glColor3f(0.0, 1.0, 0.0); glutWireSphere(0.8, 30, 30); // draw a wire cone glTranslatef(5.0, 0.0, 0.0); glColor3f(0.0, 0.6, 1.0); glutWireCone(0.8, 1.5, 20, 20); // draw a wire cube glTranslatef(-1.0, 1.4, 0.0); glColor3f(1.0, 0.3, 0.0); glutWireCube(1.0); // draw a wire torus glTranslatef(-3.0, 0.4, 0.0); glColor3f(1.0, 0.3, 1.0); glutWireTorus(0.2, 0.6, 20, 20); …
-
snake game in c++
Snake game in c++. program: #include<iostream.h> #include<conio.h> #include<graphics.h> #include<dos.h> #include<stdlib.h> #include<stdio.h> #include<time.h> #include<string.h> class snake { int p1,p2,v1,v2,v3,e1,e2,prev,now,n,colr,dsp,cnt,dly,m; int stp, egGen; int xr, yr; void caught(); public: long scr; int strX,strY,endXendY; int pos[100][2]; void show(); void init(); void egg(); void transpose(); void gnrtCond(); void gnrtUnCond(); void check(); void checkEgg(); void move(); void chngDir(); void sndEt();…
-
Animation circles filled with different colors and patterns.
Write a program to draw animation using increasing circles filled with different patterns. program: #include<graphics.h> #include<conio.h> void main() { intgd=DETECT, gm, i, x, y; intigraph(&gd, &gm, “C:\\TC\\BGI”); x=getmax x()/3; y= getmax x()/3; setbkcolor(white); setcolor(blue); for(i=1;i<=8;i++) { setfillstyle(i,i); delay(20); circle(x, y, i*20); floodfill(x-2 + i*20, y, blue); } getch();…
-
display different size circles filled with different colors and at random places using c.
program to make screen server in that display different size circle filled with different colors and at random places. program: #include<stdio.h> #include<conio.h> #include”graphics.h” #include”stdlib.h” void main() { intgd=DETECT,gm,i=0, x,xx,y,yy,r; initgraph(&gd, &gm, “C:\\TC\\BGI”); x=getmaxx(); y=getmaxy(); while(!kbhit()) { i++; circle(xx=random(x), yy=random(y), random(30)); setfillstyle(random(i), random(30)); floodfill(xx,yy,getmaxcolor()); delay(200); } getch(); } output:
-
implement digital clock using c.
write a program to implement digital clock. program: #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> struct time t; void display(int, int, int); void main() { int i=0,gd=DETECT,gm,hr,min,sec; clrscr(); initgraph(&gd,&gm,”c:\\turboc3\\bgi”); setcolor(GREEN); settextstyle(4,0,7); while(!kbhit()) { gettime(&t); hr=t.ti_hour; min=t.ti_min; sec=t.ti_sec i++, display(100,100,hr); display(200,100,min); display(300,100,sec); sound(400); delay(30); nosound(); delay(930); cleardevice(); } getch(); } void display(int x,int y,int num) {…
-
C Programming Language
Introduction C is a procedural programming language initially developed by Dennis Ritchie in the year 1972 at Bell Laboratories of AT&T Labs. It was mainly developed as a system programming language to write the UNIX operating system. The main features of the C language include: These features make the C language suitable for system programming…
-
Looking back on a year of working remotely

It is only in comparatively recent years that attention has been given to bee-keeping on a scientific basis. Aforetime there were certain traditional methods to be followed to secure the honey harvest, but those who practised them knew neither the why nor wherefore. Today, however, thanks to the observations of our great scientists on the life…
-
I check email just two times a day and it’s fine
It is only in comparatively recent years that attention has been given to bee-keeping on a scientific basis. Aforetime there were certain traditional methods to be followed to secure the honey harvest, but those who practised them knew neither the why nor wherefore. Today, however, thanks to the observations of our great scientists on the…
-
This is what a typical day looks like for me
It is only in comparatively recent years that attention has been given to bee-keeping on a scientific basis. Aforetime there were certain traditional methods to be followed to secure the honey harvest, but those who practised them knew neither the why nor wherefore. Today, however, thanks to the observations of our great scientists on the…