Python program to display Fibonacci using recursion

TLDR; In post we are going to learn how to create a fibonacci series program using recursion in python. If you are looking for code only, you can find it Here Fibonacci series Explanation The Fibonacci series is the special sequence of numbers in which next number is calculated using a formulae. first two numbers are default 0 and 1. Formula is n2 = n1 + n0 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …...

April 27, 2019 · 3 min · Rahul Rajput

Creating Square, Rectangle using * in C

In the process of learning the basic of C language people often create shapes using the *, and these shapes question are also asked in the interview question and selection exam of various companies so it is very good to learn how to make various shapes. Rectangle we can also make multiply. Multiply Code for the above images it is in the order of images. #include <iostream> using namespace std; int main() { int size; cout << "Enter Number "; cin >> size; cout << endl; for(int i=0;i<size;i++){ for(int j=0;j<size;j++){ cout << "*"; } cout << endl; } cout << endl; for(int i=0;i<size;i++){ for(int j=0;j<size;j++){ if(i == j) cout << "*"; else cout << " "; } cout << endl; } cout << endl; for(int i=0;i<size;i++){ for(int j=0;j<size;j++){ if( (size - i - 1) == j) cout << "*"; else cout << " "; } cout << endl; } cout << endl; for(int i=0;i<size;i++){ for(int j=0;j<size;j++){ if( (size - i - 1) == j || i == j) cout << "*"; else cout << " "; } cout << endl; } cout << endl; for(int i=0;i<size;i++){ for(int j=0;j<size;j++){ if(i==0 || i == (size -1)) // printing for the first and last line cout << "*"; else if((j == 0 && i !...

April 27, 2019 · 2 min · Rahul Rajput

Selection Sort using C language (with every step)

What is selection sorting The selection algorithm sorts an array by repeatedly finding the smallest element (considering increasing or ascending order) from the unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given group. Subarray that is already sorted. Remaining subarray that is unsorted. At each iteration of selection, the minimum value (with regard to rising order) is sorted from the unsorted subarray and moved to the sorted subframe....

April 27, 2019 · 2 min · Rahul Rajput

Calculating Julian Day Number (JDN) using C++

What is Julian Day Number Julian Day is the continuous number of days since the beginning of the Julian period and is mainly used by astronomers and in software to easily calculate past days between two events (eg, food production date and sales by date). Code #include<iostream> #include <limits> using namespace std; void input_data(int &month, int &year, int &day,int &bmonth, int &byear, int &bday); void calculations(int month, int year, int day, int &jdn); void output_results(int &month, int &year, int &day, int &jdn,int d); void calculate_dow(int &jdn , int &dow); void calculate_difference_and_print(int jdn , int bjdn); void pause(); int main() { int bday; int bmonth; int byear; int bjdn; int day; int month; int year; int jdn; int dow; int bdow; input_data(month, year, day,bmonth, byear, bday); // calculate JDN for the present day calculations(month, year, day, jdn); // calculate JDN for the Date of birth calculations(bmonth, byear, bday, bjdn); calculate_dow(jdn,dow); calculate_dow(bjdn,bdow); cout << endl; output_results(month, year, day, jdn,dow); output_results(bmonth, byear, bday, bjdn,bdow); calculate_difference_and_print(jdn,bjdn); pause(); } void pause(); // this module is changed to increase the functionality void input_data (int &month, int &year, int &day,int &bmonth, int &byear, int &bday) { std::cout << "enter a month(jan = 1, feb = 2, etc....

April 27, 2019 · 3 min · Rahul Rajput

Bubble Sort code in C

Bubble sort is the simplest Sorting algorithm available. It works by repeatedly swapping the adjacent or neighbor element if they are in the wrong order. Working Actually in first pass bubble sort sets the largest element to its position, in the second pass algorithm sets the second largest element this continues till the list or array is not finally sorted. Here is the example image. To work with the algorithm you first have to understand what is swapping and how it is done....

January 25, 2019 · 2 min · Rahul Rajput

Distributed Systems AKTU (UPTU) lab program

Distributed system DS is the subject mandatory subject in the seventh semester of the final year of Computer Science in Dr. APJ Abdul Kalam Technical University. Lab practical Questions. Assignment 1 Assignment 2 Assignment 3 Assignment 4 For the completed Answer of these assignments are in the link given below. Answers Thanks for being here. Subscribe to this blog for more post like this.

January 3, 2019 · 1 min · Rahul Rajput

Keywords, Comments & Variable, Introduction to C

About this Series Welcome everybody, you must be interested in learning about the programming. Guess what, you’re at the correct place. In this series we will learn about how to in and out of C language from very basics of programming to a pretty intermediate level. This post mainly contains the keywords, comments and variables in C. If you wanted to take a look at history of C then checkout my previous post in this series....

January 2, 2019 · 3 min · Rahul Rajput