Skip to main content

Posts

Showing posts with the label programming project

receives 5 numbers, and prints them back in reverse order assembly yasm/nasm/fasm

This program receives 5 numbers, and prints them back in reverse order. yasm - BITS 32 global main extern exit section .data     ; 5 dwords:     keep_nums  times 5  dd (12345678h)     section .text main:     mov ecx, 5   read_one_number:     dec     ecx     call    read_hex     mov     esi,ecx     ; Calculate the address of dword number ecx:     shl     esi,2 ; multiply by 4. Every dword is 4 bytes!     add     esi,keep_nums     ; Store the number inside dword number ecx:     mov     dword [esi],eax     test    ecx,ecx     jnz     read_one_number     mov   ...

C++ Program for Bubble Sort

C++ Programming Code for Bubble Sort #include<iostream> using namespace std; int main() {     int a[50], n,i,j,tmp;     cout<<"enter size of array";     cin >>n;     cout<<"enter array elements";     for (i=0; i<n;i++)     {         cin>>a[i];     }     for(i=1;i<n;i++)     {         for(j=0;j<(n-i);j++)             if(a[j]>a[j+1])             {                 tmp=a[j];                 a[j]=a[j+1];                 a[j+1] =tmp;            ...

C++ Program to Add 3X3 Two Matrix using for loop

A Simple C++ program to add two Matrices   #include<iostream> using namespace std; int main() {     int a[3][3], b[3][3], ab[3][3];     int z=3, x=3;     cout<<"\nEnter elements of 1st matrix:\n";     for(int i=0; i<z; i++)     {         for(int j=0; j<x; j++)         {             cin>>a[i][j];         }     }     cout<<"\nEnter elements of 2st matrix:\n";     for(int i=0; i<z; i++)     {         for(int j=0; j<x; j++)         {             cin>>b[i][j];         }     }     //Adding Two matrices   ...

Caesar cipher Decryption( C++)

 Caesar cipher Decryption #include <iostream> #include <string> #include <iterator> using namespace std; int main() {         string a;     string v;     int k = 0;     const int b =1;     cin >> a;     for(int j =0;j <25; j++)     {                 ++k;         for(int i =0; i<a.length(); i++)       {           v= ((a[i]+ k +65)%26 +65);           cout <<v;               }             cout << "\n";             }         }

C++ : Program to find simple Interest and compound Interest

Program to find simple Interest and compound Interest #include<iostream> using namespace std; int main() {     int p, r, t;     float si, ci;     cout << "Enter value for P R T" << endl;     cin >> p >>r >> t;     si = p*r*t/100;     ci = p*(1+r/100)^t;     cout << "SIMPLE INTREST = " <<si <<"\n" << "COMPOUND INTERESRT= " << ci;     return 0; }

C++ : Program to check whether the entered number is odd or even

Program to check whether the entered number is odd or even  #include <iostream> using namespace std; int main() {     int num;     cout << "Enter any number: ";     cin >> num;     if (num%2 == 0)         cout << "Number is even";     else         cout << "Number is odd";     return 0;    }

C++: program to input three numbers and print the largest of three

    Program to input three numbers and print the largest of three #include <iostream> using namespace std; int main() {     int x,y,z;     cout << "Enter three NUMBER: "<< "\n";     cin >> x >> y >> z;     if(x>y && x>z)     cout << "\n" << x << " is greater";     if (y > x && y > z)     cout << "\n" << y << " is greater";     if (z > x && z > y)     cout << "\n" << z << " is greater";     return 0;     }

C++: Program to check wether a number is greater than or less than other number

Program to check wether a number is greater than or less than other number #include <iostream> using namespace std; int main() {     int num1, num2;     cout << "Enter value for num1:"; cin >> num1;     cout << "Enter value for num2: "; cin >> num2;     if (num1 > num2)         cout << "Num1 is greater than num 2\n";     else         cout <<"num1 is smaller than num 2\n";     return 0; }

C++: Program To find Sum of Two numbers

C++: Program To find Sum of Two numbers #include <iostream> using namespace std; int main() {     int num1, num2, sum;     cout << "Enter Number 1: ";     cin >> num1;     cout << "Enter number 2: ";     cin >> num2;     sum = num1 + num2;     cout << "sum of number: " << sum << "\n";     return 0; } Output -

C++: Write a program to print the largest of 3 number using conditional operator

Write a program to print the largest of 3 number using conditional operator #include<iostream> using namespace std; int main() {     int a, b, c;     cout << "Enter 3 no\n";     cin>>a>>b>>c;     int big =  ( a>b && a>c )?a:(b>c?b:c);     cout<<"\nAmong "<<a<<" , "<<b<<" , "<<c<<" Biggest is "<<big<<endl;     return 0; }

C++: Write a Program to Find the S.I given Principal = 100 , take rate and time from the User

Write a Program to find the S.I given Principal = 100 , take rate and time from the User #include<iostream> using namespace std; int main() {     int principle = 100;     int rate, time, intrest;     cout << "Enter rate= ";     cin>>rate;     cout<<"Enter time= ";     cin>>time;     intrest=(principle*time*rate)/100;     cout <<"The intrest rate is = "<<intrest<<endl; }

C++: Program to calculate and display area of a circle

C++: Program to calculate and display area of a circle #include <iostream> using namespace std; int main() {     float radius;     float area;     cout << "enter radius:";     cin >> radius;     area = radius * radius * 3.14;     cout << "area of the circle of is:" << area;     return 0; } Result -

C++ : squaring number in C++ script

C++ : squaring number in C++ script #include <iostream> #include <stdlib.h> using namespace std; int main() {   ("cls");    //For clearscreen funtion for Turbo C++ version clscr() also work     int var, sqrs;     cout << "enter varible:";     cin >> var;     sqrs = var * var;     cout << "\n" << "The square is :" << sqrs; return 0; } Result - https://code.sololearn.com/c45mw9pXGOUs/#cpp Use this script from here

C++ : Cascading of I/O Operators

C++ : Cascading of I/O Operators  Successive occurrence of operators (">>" or "<<" respectively) can be concatenated    example 1 - cout << "The sum of 2 + 5 = " << 2 +5 \n"; example 2 - cout >> "The result of 8 - 2 is" << 8 -2; example 3 - cout << "the sum of" <<  value1 << "and" << "is" << value 1 + value2 << "\n"; example 4 - Similarly successive occurrences of input operator (>>) can also be concatenated as follows :  cout << " Enter two numbers :"; cin >> value1 >> value2; Demo - ( squaring numbers) #include <iostream> using namespace std; int main() {     int var, sqrs; cout << "enter number:\n"; cin >> var; sqrs = var * var; cout << "\nanswers\n" << sqrs << endl; } Result - Without Cascading - ...

how to create wishing page from linux

if you want to remove rockstardevil from website than paytm me 10 dollar !!!! contact detail - instagram rockstardevil34 For this Web App, you Need to create a Four Files 1 - index.php 2 - userwish.php 3 - db.php 4 - .htaccess First Create a Database on your Webserver After creating the Database run this SQL Query to create Tables for the Web App CREATE TABLE event_wishes ( id INT NOT NULL AUTO_INCREMENT, title VARCHAR (500) NOT NULL UNIQUE, str VARCHAR (500) NOT NULL UNIQUE, PRIMARY KEY (ID) ); 27 After creating Database Tables create Three files index.php - Homepage userwish.php - Greeting Page db.php - For MYSQL Database Connection Now Add this Below code on db.php File <?php $dbhost = 'localhost' ; $dbuser = 'YOUR DB USER' ; $dbpass = 'YOUR DB PASS' ; $dbname = 'YOUR DB NAME' ; $con=mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) //connect to the database server ...

PYTHON - Simple Calculator

PYTHON - Simple Calculator print("RoCk StAr DeViL") while True:   print("Options:")   print("Enter 'add' to add two numbers")   print("Enter 'subtract' to subtract two numbers")   print("Enter 'multiply' to multiply two numbers")   print("Enter 'divide' to divide two numbers")   print("Enter 'quit' to end the program")   user_input = input(":")   if user_input == "quit":     break   elif user_input == "add":     num1 = float(input("Enter a number: "))     num2 = float(input("Enter another number: "))     result = str(num1 + num2)     print("The answer is " + result)   elif user_input == "multiply":     num1 = float(input("Enter a number: "))     num2 = float(input("Enter another number: "))     result = str(num1 * num2)     print("The answer is " + result)...

python - script count whatever you write there

 this script help to check letter, number whatever even space button to write or past in terminal... bydevilzlinux byrockstardevil print "this script made to check number of message you enter it." print "\nthis script created by ROCK STAR DEVIL devilzlinux.blogspot.com" print "\nthis script check space button too.." message = raw_input("enter a message:") print "\nThe length of the message is: ", len(message) raw_input("\n\npress the enter key to exit" )

PYTHON - today day script

script that tell you today day !!!!!!!! import datetime a = datetime.datetime.today().weekday() if a == 0:     print("It's Monday.") elif a == 1:     print("It's Tuesday.") elif a == 2:     print("It's Wednesday.") elif a == 3:     print("It's Thursday.") elif a ==4:     print("It's Friday.") elif a == 5:     print("It's Saturday.") elif a == 6:     print("It's Sunday.")    

PYTHON - password Generator script

 python script project --- password Generator import string from random import * letters = string.ascii_letters  digits = string.digits  symbols = string.punctuation chars = letters + digits + symbols min_length = 8 max_length = 16 password = "".join(choice(chars) for x in range(randint(min_length, max_length))) print(password)