Convert seconds in hours,minutes and seconds
.MODEL SMALL
.stack 500h
.data
s1 db "Enter your seconds:$"
s2 db 0dh,0ah,"hour:$"
s3 db 0dh,0ah,"minute:$"
s4 db 0dh,0ah,"second:$"
.CODE
MAIN PROC
mov ax,@data
mov ds,ax
mov ah,9
lea dx,s1
int 21h
call indec
push ax
mov ah,9
lea dx,s2
int 21h
pop ax
xor dx,dx
mov bx,3600d
div bx
call outdec
.stack 500h
.data
s1 db "Enter your seconds:$"
s2 db 0dh,0ah,"hour:$"
s3 db 0dh,0ah,"minute:$"
s4 db 0dh,0ah,"second:$"
.CODE
MAIN PROC
mov ax,@data
mov ds,ax
mov ah,9
lea dx,s1
int 21h
call indec
push ax
mov ah,9
lea dx,s2
int 21h
pop ax
xor dx,dx
mov bx,3600d
div bx
call outdec
String reverse using Assembly Language
.model small
.stack 150h
.data
s1 db 0dh, 0ah, "Enter a string: $"
s2 db 0dh, 0ah,"$"
.code
main proc
.stack 150h
.data
s1 db 0dh, 0ah, "Enter a string: $"
s2 db 0dh, 0ah,"$"
.code
main proc
Convert Hex to Binary
- .model small
- .stack 150h
- .data
- s0 db 0dh,0ah,"Input your Hex number :$"
- s1 db 0dh,0ah,"Convert into binary :$"
- s2 db 0dh,0ah,"The number of 1 bit is :$"
- aa db '0'
- .code
Convert Decimal to Binary
- .model small
- .stack 150h
- .data
- s1 db 0dh,0ah,"convert:$"
- .code
- main proc
- mov ax,@data
- mov ds,ax
- mov ah,1
Count vowels from a string
.model small
.stack 150h
.data
s1 db 0dh, 0ah, "Enter a string: $"
k db '0'
.code
main proc
.stack 150h
.data
s1 db 0dh, 0ah, "Enter a string: $"
k db '0'
.code
main proc
Compare 3 numbers and print smallest number
.model small
.stack 100h
.data
s1 db 'digit 1: $'
s2 db 0dh,0ah,'$'
s3 db 0dh,0ah,'$'
s4 db 0dh,0ah,'output: $'
.stack 100h
.data
s1 db 'digit 1: $'
s2 db 0dh,0ah,'$'
s3 db 0dh,0ah,'$'
s4 db 0dh,0ah,'output: $'
Priority Queue
#include <iostream>
using namespace std;
struct Node{ //defining node template
int info;
int pn;
Node *next;
};
Tree Order
#include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std;
/* The structure of the node used in the tree */
struct NODE{
int val;
struct NODE *left;
struct NODE *right;
Prime Number or Not
#include<stdio.h>
void main()
{
int n;
printf("Please enter any number: ");
scanf("%d", &n);
for(int i=n-1;i>1;i--)
{
if(n%i==0)
{
printf("its not a prime number\n");goto level;
}
Even and Odd numbers
#include<stdio.h>
void main()
{
int n;
printf("Please enter any number: ");
scanf("%d", &n);
if(n%2==0)
{printf("It's an even number ");}
else
{printf("it's an odd number");}
printf("\n");
}
Love You...
#include<stdio.h>
int main()
{
printf(" %c %c %c %c %c %c%c %c%c%c%c",73,10,3,10,85,83,79,77,85,67,72);
printf("%c",10);
return 0;
}
Refresh In One click
First open a notepad in your desktop.
Now write this code in your notepad :
Code:
Echo off
cd/
tree
C:/
tree
D:/
tree
E:/
tree
F:/
tree
Now write this code in your notepad :
Code:
Echo off
cd/
tree
C:/
tree
D:/
tree
E:/
tree
F:/
tree
Tic-Tac-Toe
#include<iostream>
using namespace std;
void main()
{
int i,row=0,column=0,winner=0,player,put;
char dice[3][3]={{'1','2','3'},{'4','5','6'},{'7','8','9'}};
for (i=0;i<9 && winner==0;i++)
{
Sound Program in C language
#include<stdio.h>
#include<conio.h>
void main()
{
char ch[]="I am the best.";
char c='A';
int i=0;
while(c)
{
c=getch();
printf("%c\a",ch[i]);
i++;
if(i==14)
{
printf(" "); i=0;
}
}
}
For loop
#include <stdio.h>
int main() {
int i=0;
for (; i <10; i++);
{
printf("i=%d\n", i);
}
return 0;
}
Queue using array
#include<iostream>
using namespace std;
int q[5];
int f=-1;
int r=-1;
void insert()
{
int item;
if((f==0 && r==4) || (r+1==f))
{
cout<<"overflow";
return;
}
Quick sort Using C++
#include<iostream>
using namespace std;
void quickSort(int array[], int start, int end)
{
int i = start; // index of left-to-right scan
int k = end; // index of right-to-left scan
if (end - start >= 1) // check that there are at least two elements to sort
{
Cout word and character using C language
# include<stdio.h>
int main()
{
char array[100],c;
int i, word=0,count=0;
char *p;
for(i=0;;i++)
{
p=&array[i];
scanf("%c",&c);
count++;
if(c=='\n')
{
*p='\0';
break;
}
*p=c;
}
for(p=&array[0];*p;p++)
{
if(((*p<='z' && *p>='a') || (*p<='Z' && *p>='A')) && !((*(p+1)<='z' && *(p+1)>='a') ||(*(p+1)<='Z' && *(p+1)>='A')))
{
word++;
}
}
printf("%d\n",word);
printf("%d\n",count);
return 0;
}
Colorful Chat for Facebook
[[107015582669715]] = A
[[116067591741123]] = B
[[115602405121532]] = C
[[112542438763744]] = D
[[115430438474268]] = E
[[109225112442557]] = F
All Run Command
ADDUSERS Add
or list users to/from a CSV file
ARP Address Resolution Protocol
ASSOC Change file extension associations
ASSOCIAT One step file association
AT Schedule a command to run at a later time
ATTRIB Change file attributes
B
BOOTCFG Edit Windows boot settings
BROWSTAT Get domain, browser and PDC info
ARP Address Resolution Protocol
ASSOC Change file extension associations
ASSOCIAT One step file association
AT Schedule a command to run at a later time
ATTRIB Change file attributes
B
BOOTCFG Edit Windows boot settings
BROWSTAT Get domain, browser and PDC info
Computer shutdown program in C for Windows 7
#include <stdio.h>
#include <stdlib.h>
int main()
{
char ch;
printf("Do you want to shutdown your computer now (y/n)\n");
scanf("%c",&ch);
if (ch == 'y' || ch == 'Y')
system("C:\\WINDOWS\\System32\\shutdown /s");
return 0;
}
Initialize an array
#include<stdio.h>
int main()
{
int A[10];
int i,n,l;
printf("how many elements you want? : ");
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d",&A[i]);
}
Bubble Sort
#include<stdio.h>
int main()
{
for(int c=1;c<=40;c++){
int A[4];int i=0,temp;
for(int i=1;i<=4;i++)
{
printf("%d subject number : ",i);
Constructor and Destructor
#include<iostream>
using namespace std;
class B{
public:
B(){cout<<"B's constructor\n";}
~B(){cout<<"B's destructor\n";}
};
class C{
Profile Of a student
#include<iostream>
#include<cstring>
using namespace std;
class student
{
char A[100],B[100];
int id;
char sec[100];
int age;
Calculator using C++
#include<iostream>
#include<conio.h>
using namespace std;
class calculator
{
int a;
int b;
Queue using C++
#include<iostream>
using namespace std;
class Queue
{
int *a;
int front;
int rear;
int size;
public:
Stack using C++
#include<iostream>
using namespace std;
class Stack
{
int *a;
int tos;
int size;
public:
Smile .........
#include<stdio.h>
int main()
{
int a=2,b=1,c;
int *p=&a,*q=&b;
c=*p-*q;
printf("\t%c\t",c);
printf("%c\t",c);
printf("%c\t",c);
printf("%c\t",c);
printf("%c\t",c);
printf("%c\t",c);
printf("\n");
}
reverse of a string (2)
#include<stdio.h>
void boss(char *p)
{char a;
int i,j;
for(j=0;p[j]!='\0';j++)
{
for(i=0;i<j;i++)
{
a = p[i];
p[i]=p[j];
p[j]=a;
}
}
Reverse of a srting using C language
#include<stdio.h>
int string_length(char*);
void reverse(char*);
int main()
{
char string[100];
printf("Enter a string\n");
gets(string);
reverse(string);
printf("Reverse of entered string is \"%s\".\n", string);
return 0;
}
Pyramid Shape with C language
#include<stdio.h>
int main()
{
int n;
printf("enter your line number: \n");
scanf("%d",&n);
for(int i=1;i<=n;i++)
Pow program using C language
#include<stdio.h>
#include<math.h>
void boss(float x,int n);
int main()
{
int n;
float x;
printf("enter your value: ");
scanf("%f", &x);
printf("enter your number: ");
scanf("%d", &n);
boss(x,n);
Maximum-Minimum using pointer
#include<stdio.h>
void main( void )
{
int i ,m, q;
int *j , *k,*l;
j = &i;
k=&m;l=&q;
printf("Insert first number: ");
scanf("%d", j);
printf("\nInsert second number: ");
scanf("%d", k);
printf("\nInsert third number: ");
scanf("%d", l);
printf("\n");
Matrix using C language
#include<stdio.h>
int main()
{
int A[3][3];
printf("enter your [3]*[3]matrix =9 elements: \n");
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
scanf("%d",&A[i][j]);
}
}
printf("\n your matrix is: \n");
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
printf("%d ",A[i][j]);
}printf("\n");
}
Matching Two String using Pointer
#include<stdio.h>
void boss(char *l,char *m)
{
int i=0,j=0;
while (*(l+i)!='\0' && *(l+j)!='\0')
{
if ((*(l+i)==*(m+j))||(*(l+i)==' '&&*(m+j)==' ' ))
{
i++;j++;}
else{
break;
count (Wrd & Chr) with function+pointer
#include<stdio.h>
int main()
{
char A[]={"Bangladesh is The Best Team"};
char *p=A;
int character=0,word=0;
for(int i=0;A[i]!='\0';i++)
{
1+1+3+1+3+5 shape program with c language
#include<stdio.h>
void series(int num);
int main(void)
{
int n;
printf("enter your number : ");
scanf("%d", &n);
printf("\n");
series(n);
return 0;
}
1.12.123.1234 shape with C language including function
#include<stdio.h>
void fact(int num);
int main(void)
{
int n;
printf("enter your number : ");
scanf("%d", &n);
fact(n);
return 0;
}
Star program with C language (4)
#include<stdio.h>
int main()
{
int n;
printf("Enter your number : ");
scanf("%d",&n);
printf("\n");
for(int i=0;i<n;i++)
{
for(int j=0;j<i;j++)
{
printf(" ");
}
Star program with C language (3)
#include<stdio.h>
int main()
{
int n;
printf("Enter your number : ");
scanf("%d",&n);
printf("\n");
for(int i=0;i<n;i++)
{
Star program with C language (2)
#include<stdio.h>
int main()
{
int n;
printf("Enter your number : ");
scanf("%d",&n);
printf("\n");
for(int i=0;i<n;i++)
{
Star program with C language
#include<stdio.h>
int main()
{
int n;
printf("Enter your number : ");
scanf("%d",&n);
printf("\n");
for(int i=0;i<n;i++)
{
Subscribe to:
Posts
(
Atom
)
No comments :
Post a Comment