Future of world with technology grow, thrive, empower yourself, one step at a time. Sucess unlocked.
The journey of self-motivation and personal growth is a lifelong path, filled with twists and turns, triumphs and setbacks. By embracing this journey, we can develop the skills, confidence, and resilience needed to achieve our goals and live a fulfilling life. I hope that my insights and experiences will inspire and motivate you to embark on your own journey of self-discovery and growth. Join me as I share insights, experiences, and practical tips on living a fulfilling life.
Tuesday, December 24, 2019
Merry Christmas greetings
23 December,Happy Farmers Day!
Farmer's Day is celebrated every year on 23 December,
on the birthday of the 5th Prime Minister of India,
Choudhary Charan Singh, also a farmer's leader,
who introduced many policies to improve the lives of the Indian farmers.
It is celebrated by organizing various programs, debates, seminars, quiz competitions, discussions, workshops, exhibitions, essays writing competitions and functions.
Farmers are backbone of a country and you can’t stand straight if your backbone is broken.
The life of a farmer is very tough as he works very hard day and night in all seasons for us.
Happy Farmers Day!
Sunday, December 22, 2019
National Mathematics Day.
Saturday, December 21, 2019
Write a python program to check if the number is an Armstrong number or not take input from the user
Write a python program to check if the number is an Armstrong number or not take input from the user
num = int(input("Enter a number: "))
# initialize sum
sum = 0
# find the sum of the cube of each digit
temp = num
while temp > 0:
digit = temp % 10
sum += digit ** 3
temp //= 10
# display the result
if num == sum:
print(num,"is an Armstrong number")
else:
print(num,"is not an Armstrong number")
Output:
Enter a number: 407407 is an Armstrong number
Thursday, December 19, 2019
Java Program to Check a Leap Year
public class LeapYear {
public static void main(String[] args) {
int year = 1900;
boolean leap = false;
if(year % 4 == 0)
{
if( year % 100 == 0)
{
// year is divisible by 400, hence the year is a leap year
if ( year % 400 == 0)
leap = true;
else
leap = false;
}
else
leap = true;
}
else
leap = false;
if(leap)
System.out.println(year + " is a leap year.");
else
System.out.println(year + " is not a leap year.");
}
}
Output:
2020 is a leap year.
Python program to Count Alphabets Digits and Special Characters in a String using for loop
string = input("Please Enter your Own String : ")
alphabets = digits = special = 0
for i in range(len(string)):
if(string[i].isalpha()):
alphabets = alphabets + 1
elif(string[i].isdigit()):
digits = digits + 1
else:
special = special + 1
print("\nTotal Number of Alphabets in this String : ", alphabets)
print("Total Number of Digits in this String : ", digits)
print("Total Number of Special Characters in this String : ", special)
Python program to make a simple calculator
# This function adds two numbers
def add(x, y):
return x + y
# This function subtracts two numbers
def subtract(x, y):
return x - y
# This function multiplies two numbers
def multiply(x, y):
return x * y
# This function divides two numbers
def divide(x, y):
return x / y
print("Select operation.")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")
# Take input from the user
choice = input("Enter choice(1/2/3/4): ")
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
if choice == '1':
print(num1,"+",num2,"=", add(num1,num2))
elif choice == '2':
print(num1,"-",num2,"=", subtract(num1,num2))
elif choice == '3':
print(num1,"*",num2,"=", multiply(num1,num2))
elif choice == '4':
print(num1,"/",num2,"=", divide(num1,num2))
else:
print("Invalid input")
Output
Select operation.
1.Add
2.Subtract
3.Multiply
4.Divide
Enter choice(1/2/3/4): 3
Enter first number: 15
Enter second number: 14
15.0 * 14.0 = 210.0
Write C++ program to caulate height of Binary Tree from Inorder and Levelorder Traversals
#include
using namespace std;
/* Function to find index of value
in the InOrder Traversal array */
int search(int arr[], int strt, int end, int value)
{
for (int i = strt; i <= end; i++)
if (arr[i] == value)
return i;
return -1;
}
// Function to calculate the height of the Binary Tree
int getHeight(int in[], int level[], int start,
int end, int& height, int n)
{
// Base Case
if (start > end)
return 0;
// Get index of current root in InOrder Traversal
int getIndex = search(in, start, end, level[0]);
if (getIndex == -1)
return 0;
// Count elements in Left Subtree
int leftCount = getIndex - start;
// Count elements in right Subtree
int rightCount = end - getIndex;
// Declare two arrays for left and
// right subtrees
int* newLeftLevel = new int[leftCount];
int* newRightLevel = new int[rightCount];
int lheight = 0, rheight = 0;
int k = 0;
// Extract values from level order traversal array for current left subtree
for (int i = 0; i < n; i++) {
for (int j = start; j < getIndex; j++) {
if (level[i] == in[j]) {
newLeftLevel[k] = level[i];
k++;
break;
}
}
}
k = 0;
// Extract values from level order traversal array for current right subtree
for (int i = 0; i < n; i++) {
for (int j = getIndex + 1; j <= end; j++) {
if (level[i] == in[j]) {
newRightLevel[k] = level[i];
k++;
break;
}
}
}
// Recursively call to calculate height of left Subtree
if (leftCount > 0)
lheight = getHeight(in, newLeftLevel, start,
getIndex - 1, height, leftCount);
// Recursively call to calculate height of right Subtree
if (rightCount > 0)
rheight = getHeight(in, newRightLevel,
getIndex + 1, end, height, rightCount);
// Current height
height = max(lheight + 1, rheight + 1);
// Delete Auxiliary arrays
delete[] newRightLevel;
delete[] newLeftLevel;
// return height
return height;
}
// Driver program to test above functions
int main()
{
int in[] = { 4, 8, 10, 12, 14, 20, 22 };
int level[] = { 20, 8, 22, 4, 12, 10, 14 };
int n = sizeof(in) / sizeof(in[0]);
int h = 0;
cout << getHeight(in, level, 0, n - 1, h, n);
return 0;
}
Write a CPP program to find the minute at which the minute hand and hour hand coincide.
#include
#include
using namespace std;
void find_time(int h1)
{
int theta = 30 * h1;
cout << "(" << (theta * 2) << "/"
<< "11"
<< ")"
<< " minutes";
}
int main()
{
int h1 = 3;
find_time(h1);
return 0;
}
Output :
(180/11) minutes
Featured posts
рд╕्рдоाрд░्рдЯ рдЗрди्рд╡ेрд╕्рдЯिंрдЧ рдлॉрд░ рдмिрдЧिрдирд░्рд╕:
рд╕्рдоाрд░्рдЯ рдЗрди्рд╡ेрд╕्рдЯिंрдЧ рдлॉрд░ рдмिрдЧिрдирд░्рд╕: рдкैрд╕िрд╡ рдЗрдирдХрдо рдХрдоाрдиे рдХा рдЖрд╕ाрди рд░ाрд╕्рддा"। рдЗрд╕рдоें рдоैंрдиे рдмрддाрдпा рд╣ै рдХि рдХैрд╕े рдЫोрдЯी рд░рдХрдо рд╕े рд╢ुрд░ुрдЖрдд рдХрд░рдХे, рдо्рдпूрдЪुрдЕрд▓ рдл...
Popular posts
-
Here's a more comprehensive list of names for God in various languages: Indo-European Languages 1. *Sanskrit*: Brahma (рдм्рд░рд╣्рдо), Vishnu...
-
Here are some solved practical slips for Master's in Computer Science: Slip 1: Sorting Algorithms Implement the following sorting algori...