Tuesday, December 26, 2017

Program for 2D reflection along Y-axis (using graphics.h)

#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include<math.h> int main() {             int gm;             int gd=DETECT;             int x1,x2,x3,y1,y2,y3;   //initgraph(&gd,&gm,"c:\tc\bg:");      ...

Program for 2D reflection in C along X-axis (using graphics.h)

#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include<math.h> int main() {             int gm;             int gd=DETECT;             int x1,x2,x3,y1,y2,y3;   //initgraph(&gd,&gm,"c:\tc\bg:");      ...

Program for 2D schearing in C (using graphics.h)

#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include<math.h> int main() {             int gm;             int gd=DETECT;             int x1,x2,x3,y1,y2,y3,nx1,nx2,nx3,ny1,ny2,ny3;             int shx,shy;              initwindow(1200,600);    ...

Program for 2D scaling in c (using graphics.h)

#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include<math.h> int main() {             int gm;             int gd=DETECT;             int x1,x2,x3,y1,y2,y3;             int sx,sy;              initwindow(1200,600);            ...

Program for 2D translation in C (using graphics.h)

#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include<math.h> int main() {             int gm;             int gd=DETECT;             int x1,x2,x3,y1,y2,y3,nx1,nx2,nx3,ny1,ny2,ny3;             int xt,yt;              initwindow(1200,600);    ...

Tuesday, December 19, 2017

C++ program to draw a circle and ellipse in a single window (using graphics.h)

#include <graphics.h> #include <iostream> #include <conio.h> using namespace std; void circle(); void ellipse(); void plotpoints(int,int,int,int); int main(){ int gdriver = DETECT, gmode; initgraph(&gdriver,&gmode,"c:\\turboc3\\bgi"); circle(); ellipse(); getch(); closegraph(); return 0; } void circle() {     int x,y,p,xc,yc,r;  ...

Monday, December 18, 2017

C++ program to draw an ellipse using Mid-point algorithm (using graphics.h)

#include<math.h> #include <graphics.h> #include <iostream> #include <conio.h> using namespace std; void plotpoints(int,int,int,int); int main(){ int xc,yc,x,y,p,rx,ry; int gdriver = DETECT, gmode; initgraph(&gdriver,&gmode,"c:\\turboc3\\bgi"); cout<<"Enter co-ordinate for centre of ellipse:"; cin>>xc>>yc; cout<<"Enter the value of rx and ry of ellipse: "; cin>>rx>>ry; x=0; y=ry; p=ry*ry-ry*rx*rx+(1/4)*rx*rx; while((2*ry*ry*x)<(2*rx*rx*y)) {  ...

C++ program to draw a circle using Mid-point algorithm (using graphics.h)

#include <graphics.h> #include <iostream> #include <conio.h> using namespace std; int main(){ int xc,yc,x,y,p,r; int gdriver = DETECT, gmode; initgraph(&gdriver,&gmode,"c:\\turboc3\\bgi"); cout<<"Enter co-ordinate for centre of circle:"; cin>>xc>>yc; cout<<"Enter radius of circle: "; cin>>r; x = 0; y = r; p = 1-r; while(x<=y){ if(p<0){ x=x+1; y=y+0; p=p+2*x +1; } else{ x=x+1; y=y-1; p=p+2*x-2*y+1; } putpixel(xc+x,yc+y,WHITE); putpixel(xc+y,yc+x,WHITE); putpixel(xc+x,yc-y,WHITE); putpixel(xc+y,yc-x,WHITE); putpixel(xc-x,yc-y,WHITE); putpixel(xc-y,yc-x,WHITE); putpixel(xc-x,yc+y,WHITE); putpixel(xc-y,yc+x,WHITE); delay(100); } getch(); closegraph(); return...

C++ program to draw a line using Bresenham's algorithm (using graphics.h)

#include<iostream> #include<graphics.h> using namespace std; void drawline(int,int,int,int); int main(){     int gdriver=DETECT, gmode, x1, y1, x2, y2;     initgraph(&gdriver, &gmode, "c:\\turboc3\\bgi");     cout<<"Enter co-ordinates of start point: ";     cin>>x1>>y1;     cout<<"Enter co-ordinates of end point: ";     cin>>x2>>y2;  ...

C++ Program for drawing line using DAA algorithm (using graphics.h)

#include <graphics.h> #include <iostream> #include <math.h> using namespace std; int main( ) {     float x,y,x1,y1,x2,y2,dx,dy,step;     int i,gd=DETECT,gm;     initgraph(&gd,&gm,"c:\\turboc3\\bgi");     cout<<"Enter the value of x1 and y1 : ";     cin>>x1>>y1;     cout<<"Enter the value of x2 and y2: ";     cin>>x2>>y2;  ...

Thursday, December 14, 2017

Android app for my blog (Vj blog)

You can directly access my blog in your android phone through this app. Click here to downlo...

Assistant Maya

This android app will help you get your daily class routine delivered to you in the form of voice and also you can schedule your daily plans so that Maya can recall them for you whenever you require.      Click here to downlo...

Wednesday, December 13, 2017

FLAG OF NEPAL MADE IN OPENGL

Click here to download the source cod...

Sunday, October 29, 2017

Exploring Thailand: A Five-Day Adventure

It all started one year back (the planning, preparation and some sorts of online researches about that particular country). But because it was a foreign tour and it was the first time for all of us, it took quite a bit more time to gather all the informations, thus it could not happened at that time. we were five members including me, my brother, sister and my parents. Managing...

Thursday, September 28, 2017

A SIMPLE WEB BROWSER MADE IN C#

Click here to download the source fi...

Monday, August 7, 2017

CONVERSION FROM LOWER TO UPPERCASE IN 8086 PROGRAMMING

TITLE LOWER TO UPPERCASE .MODEL SMALL .STACK 64 .DATA MAXCHR DB 20 ACTCHR DB ? ACTSTR DB 20 DUP(?) RESULT DB 20 DUP(?) .CODE MAIN PROC FAR MOV AX,@DATA MOV DS,AX MOV DX,OFFSET MAXCHR MOV AH,0AH INT 21H LEA SI,ACTSTR LEA DI,RESULT MOV CX,0000H MOV BX,0000H LEA BX,ACTCHR MOV CX,[BX] L2: MOV AL,[SI] CMP AL,61H JB L1 CMP AL,7AH JA L1 SUB AL,20H L1: MOV [DI],AL INC SI INC DI LOOP L2 MOV DL,0AH MOV AH,02H INT 21H LEA DX,RESULT MOV AH,09H INT 21H MOV...

CONVERSION FROM UPPER TO LOWERCASE IN 8086 PROGRAMMING

TITLE UPPER TO LOWER CASE .MODEL SMALL .STACK 64 .DATA MAXCHR DB 20 ACTCHR DB ? ACTSTR DB 20 DUP(?) RESULT DB 20 DUP('$') .CODE MAIN PROC FAR MOV AX,@DATA MOV DS,AX MOV DX,OFFSET MAXCHR MOV AH,0AH INT 21H LEA SI,ACTSTR LEA DI,RESULT MOV CX,0000H MOV BX,0000H LEA BX,ACTCHR MOV CX,[BX] L2: MOV AL,[SI] CMP AL,41H JB L1 CMP AL,5AH JA L1 ADD AL,20H L1: MOV [DI],AL INC SI INC DI LOOP L2 MOV DL,0AH MOV AH,02H INT 21H LEA DX,RESULT MOV AH,09H INT 21H MOV...

Monday, July 31, 2017

Tic tac toe game in C

#include<stdio.h> #include<conio.h> #include<stdlib.h> #include <windows.h> int board[10] = {2,2,2,2,2,2,2,2,2,2}; int turn = 1,flag = 0; int player,comp; void menu(); void go(int n); void start_game(); void check_draw(); void draw_board(); void player_first(); void put_X_O(char ch,int pos);  COORD coord={0,0}; // this is global variable                      ...

Simple quiz in C

#include<stdio.h> #include<conio.h> #include <windows.h> #include<ctype.h> #include<stdlib.h> #include<time.h> #include<dos.h> void displayscore()  {  char name[20];  float s;  FILE *f;  system("cls");  f=fopen("score.txt","r");  fscanf(f,"%s%f",&name,&s);  printf("\n\n\t\t ");  printf("\n\n\t\t %s has secured the Highest Score %.2f",name,s);  printf("\n\n\t\t...