A

@AdnanTurjoy

Insertion sort

C++
4 years ago
/// Insert Sort #include<iostream> using namespace std; int main() { int i,a[]= {3,6,2,9,1,4,7,5},temp,ck,j,k; int n; n=sizeof(a)/sizeof(a[0]); for(i=1;i<n;i++){ temp=a[i];

Uppercase Letter to Lowercase and Lowercase to Uppercase Letter in a String

C
4 years ago
#include <stdio.h> #include<string.h> int main() { int n,i,j; char s[100]; scanf("%[^\n]s",s); n=strlen(s); for(i=0;i<n;i++){ if(s[i]>='A' && 'Z'>=s[i]){ s[i]=s[i]+32;

How to convert array of integers into an integer in C

C
4 years ago
#include <stdio.h> int main() { int a[100],n,i,k=0; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); for(int i=0;i<n;i++){ k= k*10 + a[i]; }

Program Takes input an Integer and Swap first digit with last digit

C
4 years ago
#include <stdio.h> int main() { int n,i=0,j=1,k,digit[100],temp; scanf("%d",&n); temp=n; while(temp!=0){ int r = temp%10; digit[i++]=r; temp=temp/10;

Print Prime Number 19 to 10

C
4 years ago
#include <stdio.h> int isPrime(int n){ int i; for(i=2;i<n;i++){ if(n%i==0){ return 0; }

Half Inverted Pyramid

C
4 years ago
#include<stdio.h> #include<string.h> int main() { int i, j, n;

Half Pyramid

C
4 years ago
#include<stdio.h> #include<string.h> int main() { int i, j, n;

Reverse a String

C
4 years ago
#include<stdio.h> #include<string.h> int main() { char s[100];

Count Number of Word from a string

C
4 years ago
#include <stdio.h> #include<string.h> int main() { char s[100]; scanf("%[^\n]s",s); // scan ' '

Capital consonant to small case, if consonant already in small case then no change

C
4 years ago
#include<stdio.h> #include<string.h> int main() { int l, i;

a given string change small case vowel to capital case. If vowel already in capital case then no change

C
4 years ago
#include <stdio.h> #include<string.h> int main() { char s[100]; scanf("%s",s); for(int i=0;i<strlen(s);i++){ if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u' ){ s[i]=s[i]-32; } }

ddd

C
4 years ago
#include<stdio.h> int action(int m[5], int s) { int i; for(i=0; i<5; i++)

create new table from another table with data and structure

SQL
4 years ago
CREATE TABLE empDetails ( empId INTEGER PRIMARY KEY, name TEXT NOT NULL, managerID INTEGER NOT null, gender TEXT NOT NULL ); -- create a table empSalary create table empSalary ( empId INTEGER PRIMARY KEY, project TEXT not NULL,

trigger- (BEFORE-INSERT-UPDATE)

SQL
4 years ago
CREATE TRIGGER ins_salary BEFORE INSERT ON empsalary FOR EACH ROW SET NEW.salary = NEW.salary+2000; -- salary insert korle age 2000 jog hobe tarpor insert hobe CREATE TRIGGER ins_up_salary BEFORE UPDATE ON empsalary FOR EACH ROW SET new.salary = new.salary-2000; ---- jodi update kori tahole age trigger hoye 2000 minus korbe then hobe ja hobar

trigger- (BEFORE-INSERT)

SQL
4 years ago
CREATE TRIGGER ins_salary BEFORE INSERT ON empsalary FOR EACH ROW SET NEW.salary = NEW.salary+2000; -- salary insert korle age 2000 jog hobe tarpor insert hobe CREATE TRIGGER ins_up_salary BEFORE UPDATE ON empsalary FOR EACH ROW SET new.salary = new.salary-2000; ---- jodi update kori tahole age trigger hoye 2000 minus korbe then hobe ja hobar

Nth record from a table without LIMIT

SQL
4 years ago
CREATE TABLE empDetails ( empId INTEGER PRIMARY KEY, name TEXT NOT NULL, managerID INTEGER NOT null, gender TEXT NOT NULL ); -- create a table empSalary create table empSalary ( empId INTEGER PRIMARY KEY, project TEXT not NULL,

Nth heighst record from table

SQL
4 years ago
CREATE TABLE empDetails ( empId INTEGER PRIMARY KEY, name TEXT NOT NULL, managerID INTEGER NOT null, gender TEXT NOT NULL ); -- create a table empSalary create table empSalary ( empId INTEGER PRIMARY KEY, project TEXT not NULL,

fetch top N records

SQL
4 years ago
CREATE TABLE student ( sid INTEGER PRIMARY KEY, name VARCHAR(30) NOT NULL, gender CHAR(1) NOT NULL, deptid INTEGER NOT null, salary INTEGER NOT null, joindate DATE ); -- create a department table create table department(

create an empty table from another table with only structure

SQL
4 years ago
CREATE TABLE empDetails ( empId INTEGER PRIMARY KEY, name TEXT NOT NULL, managerID INTEGER NOT null, gender TEXT NOT NULL ); -- create a table empSalary create table empSalary ( empId INTEGER PRIMARY KEY, project TEXT not NULL,

create new table from another table with data and structure

SQL
4 years ago
CREATE TABLE empDetails ( empId INTEGER PRIMARY KEY, name TEXT NOT NULL, managerID INTEGER NOT null, gender TEXT NOT NULL ); -- create a table empSalary create table empSalary ( empId INTEGER PRIMARY KEY, project TEXT not NULL,