Skip to content

Instantly share code, notes, and snippets.

View abrarShariar's full-sized avatar
🎯
Focusing

Abrar Shariar abrarShariar

🎯
Focusing
View GitHub Profile
@abrarShariar
abrarShariar / test.c
Last active January 22, 2016 13:04
SPV, push_back() , push_front
#include "spv.h"
void main(){
SPV test;
SPVconstruct(3,&test); //this shows 3 garbage values
//SPVconstruct(0,&test); //this works fine
int i;
for(i=0;i<3;i++){
@abrarShariar
abrarShariar / number_conversion.c
Created January 24, 2016 08:32
Conversion (Decimal,Binary,Hexa)
#include<stdio.h>
#include<math.h>
void main(){
int x;
printf("Press 1 for Dec to Bin \nPress 2 for Dec to Hexa \nPress 3 for Dec to Oct\n");
printf("Press 4 for Bin to Dec \nPress 5 for Bin to Hexa \nPress 6 for Bin to Oct\n");
printf("Press 7 for Oct to Dec \nPress 8 for Oct to Hexa \nPress 9 for Oct to Bin\n");
printf("Press 10 for Hexa to Dec \nPress 11 for Hexa to Bin \nPress 12 for Hexa to Oct\n\n");
scanf("%d",&x);
@abrarShariar
abrarShariar / string.asm
Created January 31, 2016 11:13
string print
.model small
.stack 100h
.data
text db "HELLO WORLD $"
.code
main proc
mov bx,@data
mov ds,bx
@abrarShariar
abrarShariar / assembly_101.asm
Created January 31, 2016 12:22
Assembly code
.model small
.stack 100h
.data
first dw 'Enter 1st Input: $'
second dw 'Enter 2nd Input: $'
dis dw 'Display:$'
a db ?
b db ?
@abrarShariar
abrarShariar / hex_int_print.asm
Last active February 1, 2016 19:58
Code for display int equivalence of hexa characcters
.model small
.stack 100h
.data
num db ?
.code
main proc
mov ax,@data
mov ds,ax
@abrarShariar
abrarShariar / sort_bubble.cpp
Created February 1, 2016 12:47
Bubble sorting in C++
#include<iostream>
using namespace std;
int main(){
int arr[]={9,4,3,12,8,0};
int sz=6;
for(int i=0;i<sz;i++){
for(int j=0;j<sz;j++){
if(arr[j]>arr[j+1]){
@abrarShariar
abrarShariar / input_output.asm
Created February 2, 2016 09:01
Taking input and storing in variable and displaying them
.model small
.stack 100h
.data
input1 db 'Enter Input[1]: $' ;define variables
input2 db 'Enter Input[2]: $'
num1 db ?
num2 db ?
@abrarShariar
abrarShariar / labSQL.txt
Last active February 3, 2016 07:06
SQL commands (sub query)
>>select customer_street from customer where customer_name in (select customer_name from borrower where loan_number in (select loan_number from loan where amount=(select max(amount) from loan)));
>> select amount from loan where amount>(select amount from loan where loan_number='L-15');
>> select customer_name,customer_city from customer where customer_name in (select customer_name from borrower where loan_number in (select loan_number from loan where branch_name in (select branch_name from loan where branch_name='Downtown')));
>> select customer_name,customer_city from customer where customer_name in (select customer_name from borrower);
>> select customer_name from borrower where loan_number in (select loan_number from loan where branch_name = (select branch_name from loan where loan_number=(select loan_number from borrower where customer_name='Adams')));
@abrarShariar
abrarShariar / reverse.asm
Created February 5, 2016 20:19
code to take 3 char input and print them in reverse way
;code to take 3 char input and print them in reverse way
.model small
.stack 100h
.data
input db 'INPUT: $'
output db 'OUTPUT: $'
.code
;case conversion (UPPER -> LOWER)
.model small
.stack 100h
.data
up db 'Upper: $'
low db 'Lower: $'
a db ?