Always with you to fascinate and feisty you.I'm blessed and I thank God for every day for everything that happens for me.
Tuesday, December 31, 2019
Confidence
In doing each work you need confidence. Confident person makes their work easily and if it's less or over both is dangerous. Confidence comes with experience, knowledge, study, talent. Achievement and goals are focus by confidence. Life makes easy to live with full strength.
आठवण
शाळेत सोडवलेली मराठीची प्रश्नपत्रिका,
आज उगाचच खुप वर्षांनी आठवली!
शाळा तर कधीचीच संपलीय, पण,
परीक्षेची धडधड मात्रं तशीच राहीलीय!!
"शब्दांचे अर्थ लिहा" म्हटल्यावर,
अचूक अर्थ आठवायचेत!
आता अर्थही बदललेत आणि,
शब्दही अनोळखी झालेत!!
"समानार्थी, विरुद्धार्थी शब्द",
गुण हमखास मिळायचेत!
आता समानार्थी भाव, विरुद्धार्थी बनलेत,
अन अर्थांचे अनर्थ झालेत!!
"गाळलेल्या जागा भरा",
हा प्रश्नं पैकीच्या पैकी गुण देणारा!
प्रश्नपत्रिकेतल्या सगळ्याच,
गाळलेल्या जागा भरल्यात!
आयुष्यातल्या काही जागा मात्रं,
आजही रिकाम्याच राहील्यात!!
पेपरातल्या "जोड्या जुळवा",
क्षणार्धात जुळायच्यात!
पण नात्यांच्या जोड्या,
कधी जुळल्यात,तर कधी,
जुळता जुळता फसल्यात!
"एका वाक्यातल्या उत्तरा"नं पाच मिनिटात,
पाच गुण मिळवून दिलेत!
आयुष्यातले काही सोप्पे प्रश्नं,
आजही तिथेच तटस्थ उभे आहेत,
एकाच जागी...उत्तराची वाट बघत..
"संदर्भासहीत स्पष्टीकरण" लिहिताच,
पाच पैकी साडेतीन गुण मिळायचेच!
आता स्पष्टीकरण देता देता,
बरेचसे संदर्भ मागे पडलेत!!
"कवितेच्या ओळी पुर्ण" करणं,
अगदी आवडता प्रश्नं!
आजही शोध सुरु आहे,
कवितेच्या सुंदर ओळींचा!
एका चालीत, एका सुरात गाताना,
मिळेल कधीतरी, पुर्णत्वं आयुष्याला!!
"निबंध लिहा", किंवा "गोष्टं लिहा",
पाचापैकी तीन गुण देणारच देणार!
आता कितीही कल्पना लढवा,
किंवा, म्हणींवरुन गोष्ट तयार करा,
पण त्याचा विस्तार मात्रं नियतीच ठरवणार!!
तेंव्हा अभ्यासक्रमावरुन परीक्षा द्यायचो!
काही प्रश्नं "option" ला ही टाकायचो!
आता परीक्षा आधीच द्यावी लागते,
अभ्यासक्रम मात्रं नंतर कळतो!!
आयुष्याचा अभ्यासक्रम अनोळखी असतो,
आणि कुठलाच प्रश्नं ऐच्छिक नसतो!!
शाळेत सोडवलेली मराठीची प्रश्नपत्रिका,
आज उगाच खुप वर्षांनी आठवली...
तेंव्हाची परीक्षा आज फारच सोप्पी वाटली!!
Hindi thoughts messages
हालात सिखाते है बाते सुनना और सहना
वरना हर शख़्स फ़ितरत से बादशाह ही होता है।
जिस झूठ पर आपने भरोसा किया.....वही आपका सत्य होता है !
वक्त उतना ही देना चाहिए किसी को जितनी जरूरत हो..... वरना...ना आपकी कदर होती है,ना आपके वक्त की..!
जिन्दगी का बहुत बडा रहस्य है की,हम जानते है हम किसके लिए जी रहे है...लेकिन ये कभी नहीं जान पाते,की हमारे लिए कौन जी रहा है !!
"छाते"और "दिमाग" की उपयोगिता तभी है जब दोनों खुले हों...वरना दोनों बोझ ही है...!!
"निंदा" से घबराकर अपने "लक्ष्य" को ना छोड़े क्योंकि "लक्ष्य" मिलते ही निंदा करने वालों की "राय" बदल जाती है...
गलती कबूल करने और गुनाह छोड़ने में कभी देर ना करें......!क्योकिं
सफर जितना लम्बा होगा
वापसी उतनी मुश्किल हो जायेगी...!!
ज़िंदगी ऐसे जियो की ख़ुद को पसंद आ जाए.....
दुनिया वालों की पसंद तो पल भर में बदलती हैं.!!!
कभी पत्थर की ठोकर से भी आती नहीं खरोंच.....कभी एक ज़रा सी बात से इन्सान बिखर जाता है.
जब जज़्बात दिमाग को शिकस्त देने लगे.....तब सब कुछ हालात पर छोड़ देना चाहिए!
एक मैं हूँ,ख़ुद को न समझ पाया आज तक.....
एक दुनिया है मेरे बारे में न जाने क्या क्या समझ गयी.....
रिश्तों को गलतियां उतना कमजोर नहीं करती.....
जितना कि गलतफहमियां कर देती हैं.
भीड़ में सब लोग अच्छे नहीं होते, और अच्छे लोगों की
भीड़ नहीं होती.
किताबों की अहमियत अपनी जगह है,पर.....सबक वही याद रहता है जो जिंदगी, वक़्त और लोग सिखाते है....
संघर्ष के समय कोई नजदीक नहीं आता.....और..
सफलता के बाद किसी को आमंत्रित नहीं करना पड़ता.....
मुश्किलें केवल बहतरीन लोगों के हिस्से में ही आती हैं .....
क्यूंकि वो लोग ही उसे बेहतरीन तरीके से अंजाम देने की ताकत रखते हैं ।
अच्छा ज़रूर बनें मगर.....साबित करने की कोशिश ना करें.
चर्चा और आरोप.....ये दो चीजें.....
सिर्फ सफल व्यक्ति के भाग्य में होती है.
ख़ुद की समझदारी भी अहमियत रखती है,
वरना अर्जुन और दुर्योधन के गुरू तो एक ही थे.
Marathi thoughts messages for good morning
*प्रेम असं दयावं....*
*की घेणाऱ्याची ओंजळ अपुरी पडावी....*
*मैत्री अशी असावी...*
*की स्वाता:च भान नसावं...!!!*
*आयुष्य असं जगावं*
*की मृत्युनेही म्हणावं......*
*तू जग अजुन ,मी येईन नंतर...!!!*
*चूक नसतानासुध्दा निव्वळ वाद टाळण्याकरिता मागितलेली माफी, जीवनातील संयमाचं एक मोठं उदाहरण ठरतं..!*
*जीवनात संयम राखला तर आपले अस्तिव कुणीच संपवू शकत नाही..!!*
*परमेश्वर सर्वांभुती आहे... फक्त तो आहे याची आठवण प्रत्येक कृती करताना ठेवली तर चांगल आणि फक्त चांगलच कर्म घडेल..*
*शुभ सकाळ*
Quotes by Ratan Tata
Quotes by Ratan Tata :
1. Ups and downs in life are very important to keep us going, because a straight line even in an E.C.G means we are not alive.
2. Take the stones people throw at you. And use them to build a monument.
3. I don't believe in taking right decisions. I take decisions and then make them right.
4. If you want to walk fast, walk alone. But if you want to walk far, walk together.
5. I don't believe in taking right decisions, I take decisions and make them right.
6. Power and wealth are not two of my main stakes.
7. None can destroy iron, but its own rust can. Likewise none can destroy a person but his own mindset can.
8. The day I am not able to fly will be a sad day for me.
9. Don't be serious, enjoy life as it comes.
1. Ups and downs in life are very important to keep us going, because a straight line even in an E.C.G means we are not alive.
2. Take the stones people throw at you. And use them to build a monument.
3. I don't believe in taking right decisions. I take decisions and then make them right.
4. If you want to walk fast, walk alone. But if you want to walk far, walk together.
5. I don't believe in taking right decisions, I take decisions and make them right.
6. Power and wealth are not two of my main stakes.
7. None can destroy iron, but its own rust can. Likewise none can destroy a person but his own mindset can.
9. Don't be serious, enjoy life as it comes.
Study quotes:
Study quotes:
1. "We do not need to proselytise either by our speech or by our writing. We can only do so really with our lives. Let our lives be open books for all to study." - - Mahatma Gandhi
2. "Japan's very interesting. Some people think it copies things. I don't think that anymore. I think what they do is reinvent things. They will get something that's already been invented and study it until they thoroughly understand it. In some cases, they understand it better than the original inventor." --Steve Jobs
3. "The study of mathematics, like the Nile, begins in minuteness but ends in magnificence." - - Charles Caleb Colton
4. "To know oneself is to study oneself in action with another person." - - Bruce Lee
1. "We do not need to proselytise either by our speech or by our writing. We can only do so really with our lives. Let our lives be open books for all to study." - - Mahatma Gandhi
2. "Japan's very interesting. Some people think it copies things. I don't think that anymore. I think what they do is reinvent things. They will get something that's already been invented and study it until they thoroughly understand it. In some cases, they understand it better than the original inventor." --Steve Jobs
3. "The study of mathematics, like the Nile, begins in minuteness but ends in magnificence." - - Charles Caleb Colton
4. "To know oneself is to study oneself in action with another person." - - Bruce Lee
Strength quotes
Strength quotes:
1. “Strength does not come from winning. Your struggles develop your strengths. When you go through hardships and decide not to surrender, that is strength.” -- Arnold Schwarzenegger
2. “There are better starters than me but I’m a strong finisher.” --Usain Bolt
3. "If four things are followed - having a great aim, acquiring knowledge, hard work, and perseverance - then anything can be achieved." -- A. P. J. Abdul Kalam
4."Crush your individuality first. Shake off the dreams of personal comfort. Then start to work. Inch by inch you shall have to proceed. It needs courage, perseverance and very strong determination. No difficulties and no hardships shall discourage you. No failure and betrayals shall dishearten you. No travails (!) imposed upon you shall snuff out the revolutionary will in you. Through the ordeal of sufferings and sacrifice you shall come out victorious. And these individual victories shall be the valuable assets of the revolution." -- Bhagat Singh
5."Strength does not come from physical capacity. It comes from an indomitable will." -- Mahatma Gandhi
1. “Strength does not come from winning. Your struggles develop your strengths. When you go through hardships and decide not to surrender, that is strength.” -- Arnold Schwarzenegger
2. “There are better starters than me but I’m a strong finisher.” --Usain Bolt
3. "If four things are followed - having a great aim, acquiring knowledge, hard work, and perseverance - then anything can be achieved." -- A. P. J. Abdul Kalam
4."Crush your individuality first. Shake off the dreams of personal comfort. Then start to work. Inch by inch you shall have to proceed. It needs courage, perseverance and very strong determination. No difficulties and no hardships shall discourage you. No failure and betrayals shall dishearten you. No travails (!) imposed upon you shall snuff out the revolutionary will in you. Through the ordeal of sufferings and sacrifice you shall come out victorious. And these individual victories shall be the valuable assets of the revolution." -- Bhagat Singh
5."Strength does not come from physical capacity. It comes from an indomitable will." -- Mahatma Gandhi
Motivational quotes:
Motivational quotes:
1. Well done is better than well said.
2. Life is 10% what happens to you and 90% how you react to it.
3. With the new day comes new strength and new thoughts.
4.The world is full of magical things patiently waiting for our wits to grow sharper.
5.The good life is one inspired by love and guided by knowledge.
1. Well done is better than well said.
2. Life is 10% what happens to you and 90% how you react to it.
3. With the new day comes new strength and new thoughts.
4.The world is full of magical things patiently waiting for our wits to grow sharper.
5.The good life is one inspired by love and guided by knowledge.
Motivation words
1. Your time will come, keep trying.
2. Sometimes not getting what do you want is a perfect stroke of luck. The best things may wait for you.
3. Never give up, try to find opportunities and all possible options and the best got clicked.
4. Silently assess your strength and weakness write down your options and try everything .
5. Make yourself ready for opportunities.
Happy birthday message in hindi
दुआ है की कामयाबी के हर सिखर पे आप का नाम होगा,
आपके हर कदम पर दुनिया का सलाम होगा,
हिम्मत से मुश्किलों का समाना करना
हमारी दुआ है की वक़्त भी एक दिन आपका गुलाम होगा...!!
शुभ जन्मदिन की मुबारक बाद
ज़िंदगी की कुछ खास दुआए लेलो हमसे
जन्मदिन पर कुछ नजराने ले लो हमसे
भर दे रंग जो तेरे जीवन के पलो में…..
आज वो हसी मुबारक बाद ले लो हमसे
हँसते रहे आप करोड़ों के बीच,
लीखते रहे आप लाखोँ के बीच,
रोशन रहे आप हज़ारों के बीच,
जैसे सूरज है इतने सितारों के बीच,
जनम दिन की ढेर सारी बधाई ।
जीवन के रास्ते हमेशा गुलज़ार रहे,
चेहरे पर आपके सदा ही मुस्कान रहे,
देता है दिल ये दुआ आपके
ज़िन्दगी में आपके हर दिन,
खुशियों की बौछार हो।
Happy birthday message in marathi
शिखरे उत्कर्षाची सर तुम्ही
करीत रहावी….
कधी वळून पाहता आमची
शुभेच्छा स्मरावी….
तुमच्या इच्छा आकांक्षांचा
वेलू गगनाला भिडू दे….
तुमच्या जीवनात सर्वकाही
मनासारखे घडू दे….
तुला दीर्घायुष्य लाभो ही इच्छा….
वाढदिवसाच्या खूप खूप शुभेच्छा
तुला तुझ्या आयुष्यात सुख,
आनंद व यश लाभो,
तुझे जीवन हे उमलत्या
फुलासारखे फुलून जावो,
त्याचा सुगंध तुझ्या सर्व
जीवनात दरवळत राहो,
हीच तुझ्या वाढदिवसानिमित्त
ईश्वरचरणी प्रार्थना !
आयुष्यात हवं ते सारं काही मिळालं तरी या प्राप्तीचा मोहोत्सव करताना हवी असतात… काही आपली माणसं ! आपण सगळेच एकमेकांशी इतके जोडले गेलोय कि कोणतंही अंतर आपल्याला एकमेकांपासून दुरावू शकत नाही.. आजच्या या वाढदिवसानिमित्त म्हणूनच, आपल्या नात्याचं आणि या वाढदिवसाचं सेलिब्रेशन करावसं वाटतंय… Many Many Happy Returns Of the Day.
Resignation letter format
Resignation letter format:
Name :
Organization :
Employee Code :
Branch :
I would like to inform you that I am resigning from my position as _______ on deputation for XYZ company name, at location/ branch name, due to my personal and family reason.
Due to my personal reason I am requesting you to relieve me on mention the date.
Thank you for the support and the opportunities that you have provided me during year.
I have truly enjoyed my tenure with XYZ company name, and am more than grateful for the encouragement you have given me in pursuing my professional and personal growth objectives.
If I can be of any assistance during this transition in order to facilitate the seamless passing of my responsibilities to my successor, please let me know. I would be glad to help however I can.
Have a great day ahead.
Best Regards,
Name :
Organization :
Employee Code :
Branch :
I would like to inform you that I am resigning from my position as _______ on deputation for XYZ company name, at location/ branch name, due to my personal and family reason.
Due to my personal reason I am requesting you to relieve me on mention the date.
Thank you for the support and the opportunities that you have provided me during year.
I have truly enjoyed my tenure with XYZ company name, and am more than grateful for the encouragement you have given me in pursuing my professional and personal growth objectives.
If I can be of any assistance during this transition in order to facilitate the seamless passing of my responsibilities to my successor, please let me know. I would be glad to help however I can.
Have a great day ahead.
Best Regards,
Acceptance of offer letter format
Acceptance of offer letter:
It was wonderful to speak with you on the phone about the Designation __________ role at XYZ Company. I'm thrilled to formally accept this job offer.
I'm looking forward to working with you, and the rest of the senior management team at XYZ, on charting a new direction for marketing strategy.
As we discussed, my start date will be ______, with an annual / monthly salary of ________ .
I'm looking forward to seeing you next day.
Please let me know if there is any paperwork or additional information you need from me beforehand, or if there is any documentation I should bring along on my first day.
I'm always available on email, but feel free to call if that's more convenient Mobile_______ .
Again, thank you so much for this opportunity.
Thank You.
Have a great day ahead.
Best Regards,
Your Name
It was wonderful to speak with you on the phone about the Designation __________ role at XYZ Company. I'm thrilled to formally accept this job offer.
I'm looking forward to working with you, and the rest of the senior management team at XYZ, on charting a new direction for marketing strategy.
As we discussed, my start date will be ______, with an annual / monthly salary of ________ .
I'm looking forward to seeing you next day.
Please let me know if there is any paperwork or additional information you need from me beforehand, or if there is any documentation I should bring along on my first day.
I'm always available on email, but feel free to call if that's more convenient Mobile_______ .
Again, thank you so much for this opportunity.
Thank You.
Have a great day ahead.
Best Regards,
Your Name
Monday, December 30, 2019
Happy new year 2020 shayari wishes
“इस साल आपके घर खुशियों की हो धमाल,
दौलत की ना हो कमी आप हो जाए मालामाल,
मुस्कुराते रहो ऐसा हो सबका हाल,
तहे दिल से मुबारक हो आपको नया साल 20 20।"
“सबके दिलों में हो सबके लिए प्यार;
आने वाला हर दिन लाए खुशियों का त्यौहार,
इस उम्मीद के साथ आओ भूलके सारे गम,
न्यू इयर को हम सब करें वेलकम।”
नए साल 2020 कि शुभकामनाये ।
Python isinstance()
In Python isinstance() :
isinstance()
The Python isinstance() function is used to check whether the object or variable is an instance of the specified class type or data type.
The isinstance() syntax and parameter:
isinstance(object, classinfo)
The isinstance() function checks if the object argument is an instance or subclass of classinfo class argument.
isinstance Parameters:
The isinstance() takes two arguments, and both are mandatory.
object: The object/instance or variable to check. The object can be any class object or any variable name.
classinfo: Class info is type name, class name or tuple of types and classes. For example, int, str, list, dict, or any user-created class.
Return Value from isinstance():
If an object or variable is of a specified type, then isinstance() return true otherwise false.
example:
marks = 71
result = isinstance(marks, int)
if result :
print("Yes! given variable is an instance of type int")
else:
print("No! given variable is not an instance of type int")
Output:
Yes! given varible is an instance of type int
Using Python isinstance(), you can do the followings:
1.Check the type of a Python variable is of a given type.
2.Verify whether a variable is a number or string.
3.Check if an object is an instance of a specified class.
4.Check whether variable or object is of dict type, list type, set type, tuple type.
isinstance() with Python Class
A isinstance() function test object is of a specified class type. isinstance() is working as a comparison operator because it compares the object with the specified class type.
The isinstance result will be true if the object is an instance of the given class type:
Example:
class Employee:
def __init__(self, name, salary):
self.name = name
self.salary = salary
class Person:
def __init__(self, name, sex):
self.name = name
self.sex = sex
emp = Employee("Tom", 10000)
per = Person("Cruise", "male")
print("Checking emp object is an instance of Employee")
if isinstance(emp, Employee) :
print("Yes! given object is an instance of class Employee\n")
else:
print("No! given object is not an instance of class Employee")
print("Checking per object is an instance of Employee")
if isinstance(per, Employee) :
print("Yes! given object is an instance of class Employee")
else:
print("No! given object is not an instance of class Employee\n")
Output:
Checking emp object is an instance of Employee
Yes! a given object is an instance of class Employee
Checking per object is an instance of Employee
No! given object is not an instance of class Employee
The isinstance function works on the principle of the is-a relationship. The concept of an is-a relationship is based on class inheritance.
isinstance()
The Python isinstance() function is used to check whether the object or variable is an instance of the specified class type or data type.
The isinstance() syntax and parameter:
isinstance(object, classinfo)
The isinstance() function checks if the object argument is an instance or subclass of classinfo class argument.
isinstance Parameters:
The isinstance() takes two arguments, and both are mandatory.
object: The object/instance or variable to check. The object can be any class object or any variable name.
classinfo: Class info is type name, class name or tuple of types and classes. For example, int, str, list, dict, or any user-created class.
Return Value from isinstance():
If an object or variable is of a specified type, then isinstance() return true otherwise false.
example:
marks = 71
result = isinstance(marks, int)
if result :
print("Yes! given variable is an instance of type int")
else:
print("No! given variable is not an instance of type int")
Output:
Yes! given varible is an instance of type int
Using Python isinstance(), you can do the followings:
1.Check the type of a Python variable is of a given type.
2.Verify whether a variable is a number or string.
3.Check if an object is an instance of a specified class.
4.Check whether variable or object is of dict type, list type, set type, tuple type.
isinstance() with Python Class
A isinstance() function test object is of a specified class type. isinstance() is working as a comparison operator because it compares the object with the specified class type.
The isinstance result will be true if the object is an instance of the given class type:
Example:
class Employee:
def __init__(self, name, salary):
self.name = name
self.salary = salary
class Person:
def __init__(self, name, sex):
self.name = name
self.sex = sex
emp = Employee("Tom", 10000)
per = Person("Cruise", "male")
print("Checking emp object is an instance of Employee")
if isinstance(emp, Employee) :
print("Yes! given object is an instance of class Employee\n")
else:
print("No! given object is not an instance of class Employee")
print("Checking per object is an instance of Employee")
if isinstance(per, Employee) :
print("Yes! given object is an instance of class Employee")
else:
print("No! given object is not an instance of class Employee\n")
Output:
Checking emp object is an instance of Employee
Yes! a given object is an instance of class Employee
Checking per object is an instance of Employee
No! given object is not an instance of class Employee
The isinstance function works on the principle of the is-a relationship. The concept of an is-a relationship is based on class inheritance.
Happy New Year 2020
In this new year,your every wish and may God fill you with lots of happiness,
With these prayers, Happy New Year to you.
Happy new year full of new expectations,
Congratulations on this trick of happiness.
All your dreams are complete this year
Wishing you a very happy year.
Happy New Year 2020.
Saturday, December 28, 2019
Write an assembly program for 8085 microprocessor to find greatest between two numbers
Write an assembly program for 8085 microprocessor to find greatest between two numbers
Program:
MVI B, 30H
MVI C, 40H
MOV A, B
CMP C
JZ EQU
JC GRT
OUT PORT1
HLT
EQU: MVI A, 01H
OUT PORT1
HLT
GRT: MOV A, C
OUT PORT1
HLT
Write an assembly program for 8085 microprocessor to multiply a number by 8
Write an assembly program for 8085 microprocessor to multiply a number by 8
Program:
MVI A, 30H
RRC
RRC
RRC
OUT PORT1
HLT
Program:
MVI A, 30H
RRC
RRC
RRC
OUT PORT1
HLT
Write a program for 8085 microprocessor to arrange first 10 numbers from memory address 3000H in an ascending order.
Write a program for 8085 microprocessor to arrange first 10 numbers from memory address 3000H in an ascending order.
Answer:
MVI B, 09 :"Initialize counter"
START :"LXI H, 3000H: Initialize memory pointer"
MVI C, 09H :"Initialize counter 2"
BACK: MOV A, M :"Get the number"
INX H :"Increment memory pointer"
CMP M :"Compare number with next number"
JC SKIP :"If less, don’t interchange"
JZ SKIP :"If equal, don’t interchange"
MOV D, M
MOV M, A
DCX H
MOV M, D
INX H :"Interchange two numbers"
SKIP:DCR C :"Decrement counter 2"
JNZ BACK :"If not zero, repeat"
DCR B :"Decrement counter 1"
JNZ START
HLT :"Terminate program execution"
Answer:
MVI B, 09 :"Initialize counter"
START :"LXI H, 3000H: Initialize memory pointer"
MVI C, 09H :"Initialize counter 2"
BACK: MOV A, M :"Get the number"
INX H :"Increment memory pointer"
CMP M :"Compare number with next number"
JC SKIP :"If less, don’t interchange"
JZ SKIP :"If equal, don’t interchange"
MOV D, M
MOV M, A
DCX H
MOV M, D
INX H :"Interchange two numbers"
SKIP:DCR C :"Decrement counter 2"
JNZ BACK :"If not zero, repeat"
DCR B :"Decrement counter 1"
JNZ START
HLT :"Terminate program execution"
Friday, December 27, 2019
To be happy:
To be happy:
Always be happy you keep yourself happy by doing the right thing you what to do.
Happiness is the feeling of getting joy in what you are doing.
A smile keeps you happy which can make your life ,always smile on your face is not easy way there may be downs where you need to keep yourself strong mentally as well as physically.
Make a habit to be always happy with a smile on your face.Think that what will be the last of all this id death which everyone will face ,some may face before you some after you ,so why to worry enjoy your life.
After your death how will you can be happy as life is once. Birthday is always wished Happy birthday so make every day your birthday which will make your everyday happy i.e. Happy Everyday.
To keep yourself happy depends on how much time you want to be as if you think about yourself it will make only you happy for sometime but if you help others to make their life happy it will make you happy for lifetime.
Always be happy you keep yourself happy by doing the right thing you what to do.
Happiness is the feeling of getting joy in what you are doing.
A smile keeps you happy which can make your life ,always smile on your face is not easy way there may be downs where you need to keep yourself strong mentally as well as physically.
Make a habit to be always happy with a smile on your face.Think that what will be the last of all this id death which everyone will face ,some may face before you some after you ,so why to worry enjoy your life.
After your death how will you can be happy as life is once. Birthday is always wished Happy birthday so make every day your birthday which will make your everyday happy i.e. Happy Everyday.
To keep yourself happy depends on how much time you want to be as if you think about yourself it will make only you happy for sometime but if you help others to make their life happy it will make you happy for lifetime.
Python program to check if a string is palindrome or not
Python program to check if a string is palindrome or not
Answer:
my_str = 'Madam'
my_str = my_str.casefold()
rev_str = reversed(my_str)
if list(my_str) == list(rev_str):
print("The string is a palindrome.")
else:
print("The string is not a palindrome.")
Output:
The string is a palindrome.
Answer:
my_str = 'Madam'
my_str = my_str.casefold()
rev_str = reversed(my_str)
if list(my_str) == list(rev_str):
print("The string is a palindrome.")
else:
print("The string is not a palindrome.")
Output:
The string is a palindrome.
C++ code to implement Sierpinski Triangle using Graphics
C++ code to implement Sierpinski Triangle using Graphics
#include
#include
#include
#define Y 900
#define X 1600
void triangle(float x, float y,
float h, int colorVal)
{
setcolor(colorVal % 15 + 1);
for (float delta = 0; delta > -5; delta -= 1) {
line(x - (h + delta) / sqrt(3),
y - (h + delta) / 3,
x + (h + delta) / sqrt(3),
y - (h + delta) / 3);
line(x - (h + delta) / sqrt(3),
y - (h + delta) / 3,
x,
y + 2 * (h + delta) / 3);
line(x,
y + 2 * (h + delta) / 3,
x + (h + delta) / sqrt(3),
y - (h + delta) / 3);
}
}
void trianglev2(float x, float y,
float h, int colorVal)
{
setcolor(colorVal % 15 + 1);
for (float delta = 0; delta > -1 + 5; delta -= 1) {
line(x - (h + delta) / sqrt(3),
y + (h + delta) / 3,
x + (h + delta) / sqrt(3),
y + (h + delta) / 3);
line(x - (h + delta) / sqrt(3),
y + (h + delta) / 3,
x,
y - 2 * (h + delta) / 3);
line(x,
y - 2 * (h + delta) / 3,
x + (h + delta) / sqrt(3),
y + (h + delta) / 3);
}
}
int drawTriangles(float x = X / 2,
float y = 2 * Y / 3,
float h = Y / 2,
int colorVal = 0)
{
if (h < 5) {
return 0;
}
if (x > 0 && y > 0 && x < X && y < Y) {
triangle(x, y, h, colorVal);
}
drawTriangles(x,
y - 2 * h / 3,
h / 2,
colorVal + 1);
drawTriangles(x - h / sqrt(3),
y + h / 3,
h / 2,
colorVal + 1);
drawTriangles(x + h / sqrt(3),
y + h / 3,
h / 2,
colorVal + 1);
return 0;
}
int main()
{
initwindow(X, Y);
trianglev2(X / 2, 2 * Y / 3, Y, 2);
drawTriangles();
getch();
closegraph();
return 0;
}
#include
#include
#include
#define Y 900
#define X 1600
void triangle(float x, float y,
float h, int colorVal)
{
setcolor(colorVal % 15 + 1);
for (float delta = 0; delta > -5; delta -= 1) {
line(x - (h + delta) / sqrt(3),
y - (h + delta) / 3,
x + (h + delta) / sqrt(3),
y - (h + delta) / 3);
line(x - (h + delta) / sqrt(3),
y - (h + delta) / 3,
x,
y + 2 * (h + delta) / 3);
line(x,
y + 2 * (h + delta) / 3,
x + (h + delta) / sqrt(3),
y - (h + delta) / 3);
}
}
void trianglev2(float x, float y,
float h, int colorVal)
{
setcolor(colorVal % 15 + 1);
for (float delta = 0; delta > -1 + 5; delta -= 1) {
line(x - (h + delta) / sqrt(3),
y + (h + delta) / 3,
x + (h + delta) / sqrt(3),
y + (h + delta) / 3);
line(x - (h + delta) / sqrt(3),
y + (h + delta) / 3,
x,
y - 2 * (h + delta) / 3);
line(x,
y - 2 * (h + delta) / 3,
x + (h + delta) / sqrt(3),
y + (h + delta) / 3);
}
}
int drawTriangles(float x = X / 2,
float y = 2 * Y / 3,
float h = Y / 2,
int colorVal = 0)
{
if (h < 5) {
return 0;
}
if (x > 0 && y > 0 && x < X && y < Y) {
triangle(x, y, h, colorVal);
}
drawTriangles(x,
y - 2 * h / 3,
h / 2,
colorVal + 1);
drawTriangles(x - h / sqrt(3),
y + h / 3,
h / 2,
colorVal + 1);
drawTriangles(x + h / sqrt(3),
y + h / 3,
h / 2,
colorVal + 1);
return 0;
}
int main()
{
initwindow(X, Y);
trianglev2(X / 2, 2 * Y / 3, Y, 2);
drawTriangles();
getch();
closegraph();
return 0;
}
Python program to sort alphabetically the words form a string provided by the user
Python program to sort alphabetically the words form a string provided by the user
Answer:
my_str = input("Enter a string: ")
words = my_str.split()
words.sort()
print("The sorted words are:")
for word in words:
print(word)
Output:
Enter a string: Hello this Is an Example
The sorted words are:
Example
Hello
Is
an
this
Answer:
my_str = input("Enter a string: ")
words = my_str.split()
words.sort()
print("The sorted words are:")
for word in words:
print(word)
Output:
Enter a string: Hello this Is an Example
The sorted words are:
Example
Hello
Is
an
this
C++ program to implement Selection Sort
C++ program to implement Selection Sort:
#include
using namespace std;
void swap(int &a, int &b)
{
int temp;
temp = a;
a = b;
b = temp;
}
void display(int *array, int size)
{
for(int i = 0; i cout << array[i] << " ";
cout << endl;
}
void selectionSort(int *array, int size)
{
int i, j, k;
for(i = 0; i {
k = i;
for(j = i+1; j if(array[j] < array[k])
k = j;
swap(array[i], array[k]);
}
}
int main()
{
int n;
cout << "Enter the number of elements: ";
cin >> n;
int arr[n];
cout << "Enter elements:" << endl;
for(int i = 0; i {
cin >> arr[i];
}
cout << "Array before Sorting: ";
display(arr, n);
selectionSort(arr, n);
cout << "Array after Sorting: ";
display(arr, n);
}
Output
Enter the number of elements: 4
Enter elements:
5 9 7 23
Array before Sorting: 5 9 7 23
Array after Sorting: 5 7 9 23
#include
using namespace std;
void swap(int &a, int &b)
{
int temp;
temp = a;
a = b;
b = temp;
}
void display(int *array, int size)
{
for(int i = 0; i
cout << endl;
}
void selectionSort(int *array, int size)
{
int i, j, k;
for(i = 0; i
k = i;
for(j = i+1; j
k = j;
swap(array[i], array[k]);
}
}
int main()
{
int n;
cout << "Enter the number of elements: ";
cin >> n;
int arr[n];
cout << "Enter elements:" << endl;
for(int i = 0; i
cin >> arr[i];
}
cout << "Array before Sorting: ";
display(arr, n);
selectionSort(arr, n);
cout << "Array after Sorting: ";
display(arr, n);
}
Output
Enter the number of elements: 4
Enter elements:
5 9 7 23
Array before Sorting: 5 9 7 23
Array after Sorting: 5 7 9 23
C++ program to implement Bubble Sort.
C++ program to implement Bubble Sort.
#include
using namespace std;
void BubbleSort (int arr[], int n)
{
int i, j;
for (i = 0; i < n; ++i)
{
for (j = 0; j < n-i-1; ++j)
{
if (arr[j] > arr[j+1])
{
arr[j] = arr[j]+arr[j+1];
arr[j+1] = arr[j]-arr[j + 1];
arr[j] = arr[j]-arr[j + 1];
}
}
}
}
int main()
{
int n, i;
cout<<"\nEnter the number of data element to be sorted: ";
cin>>n;
int arr[n];
for(i = 0; i < n; i++)
{
cout<<"Enter element "< cin>>arr[i];
}
BubbleSort(arr, n);
cout<<"\nSorted Data ";
for (i = 0; i < n; i++)
cout<<"->"<
return 0;
}
#include
using namespace std;
void BubbleSort (int arr[], int n)
{
int i, j;
for (i = 0; i < n; ++i)
{
for (j = 0; j < n-i-1; ++j)
{
if (arr[j] > arr[j+1])
{
arr[j] = arr[j]+arr[j+1];
arr[j+1] = arr[j]-arr[j + 1];
arr[j] = arr[j]-arr[j + 1];
}
}
}
}
int main()
{
int n, i;
cout<<"\nEnter the number of data element to be sorted: ";
cin>>n;
int arr[n];
for(i = 0; i < n; i++)
{
cout<<"Enter element "< cin>>arr[i];
}
BubbleSort(arr, n);
cout<<"\nSorted Data ";
for (i = 0; i < n; i++)
cout<<"->"<
return 0;
}
Program in python to demonstrate star pattern after 180 degree rotation
Program in python to demonstrate star pattern after 180 degree rotation
Answer:
def pypart2(n):
k = 2*n - 2
for i in range(0, n):
for j in range(0, k):
print(end=" ")
k = k - 2
for j in range(0, i+1):
print("* ", end="")
print("\r")
n = 5
pypart2(n)
Output:
*
* *
* * *
* * * *
* * * * *
Answer:
def pypart2(n):
k = 2*n - 2
for i in range(0, n):
for j in range(0, k):
print(end=" ")
k = k - 2
for j in range(0, i+1):
print("* ", end="")
print("\r")
n = 5
pypart2(n)
Output:
*
* *
* * *
* * * *
* * * * *
Program in python to demonstrate star pattern printing triangle
Program in python to demonstrate star pattern printing triangle
Answer:
def triangle(n):
k = 2*n - 2
for i in range(0, n):
for j in range(0, k):
print(end=" ")
k = k - 1
for j in range(0, i+1):
print("* ", end="")
print("\r")
n = 5
triangle(n)
Output:
*
* *
* * *
* * * *
* * * * *
Answer:
def triangle(n):
k = 2*n - 2
for i in range(0, n):
for j in range(0, k):
print(end=" ")
k = k - 1
for j in range(0, i+1):
print("* ", end="")
print("\r")
n = 5
triangle(n)
Output:
*
* *
* * *
* * * *
* * * * *
Wednesday, December 25, 2019
Tuesday, December 24, 2019
Merry Christmas greetings
“Christmas season is the time of sharing. Start sharing LOVE and HOPE to your FAMILY. Eventually, the Love you have shared will also be imparted to everyone in your society. Let LOVE fill the air. Merry Christmas to you and your family!”
23 December,Happy Farmers Day!
The National Farmers Day in India is also known as Kisan Divas in Hindi.
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!
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.
The Indian government declared 22 December to be National Mathematics Day. This was announced by Prime Minister Manmohan Singh on 26 February 2012 at Madras University, during the inaugural ceremony of the celebrations to mark the 125th anniversary of the birth of the Indian mathematical genius Srinivasa Ramanujan (22 Dec 1887 -26 Apr 1920). On this occasion Singh also announced that 2012 would be celebrated as the National Mathematics Year.
Srinivasa Iyengar Ramanujan was born on December 22, 1887 in the present day Tamil Nadu, India. He is one of the most recognised Indian mathematicians although he had almost no formal training in pure mathematics. He is known for mathematical analysis, number theory, infinite series, and continued fractions, including solutions to mathematical problems considered to be unsolvable.
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: 407
407 is an Armstrong number
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: 407
407 is an Armstrong number
Thursday, December 19, 2019
Java Program to Check a Leap Year
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.
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
# 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)
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
# 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
# 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
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;
}
#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.
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
#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
Wednesday, December 18, 2019
Python program to check if year is a leap year or not
# Python program to check if year is a leap year or not
#to check the year
#year = 2020
#To get year (integer input) from the user
year = int(input("Enter a year: "))
if (year % 4) == 0:
if (year % 100) == 0:
if (year % 400) == 0:
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))
else:
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))
Output:
Enter a year: 2020
2020
2020 is a leap year
#to check the year
#year = 2020
#To get year (integer input) from the user
year = int(input("Enter a year: "))
if (year % 4) == 0:
if (year % 100) == 0:
if (year % 400) == 0:
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))
else:
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))
Output:
Enter a year: 2020
2020
2020 is a leap year
Tuesday, December 17, 2019
The Countries of the World and their Capitals(general knowledge question)
List of countries of the World and their Capitals:
- Afghanistan: Kabul
- Albania: Tirana
- Algeria: Algiers
- Andorra: Andorra la Vella
- Angola: Luanda
- Antigua and Barbuda: Saint John's
- Argentina: Buenos Aires
- Armenia: Yerevan
- Australia: Canberra
- Austria: Vienna
- Azerbaijan: Baku
- The Bahamas: Nassau
- Bahrain: Manama
- Bangladesh: Dhaka
- Barbados: Bridgetown
- Belarus: Minsk
- Belgium: Brussels
- Belize: Belmopan
- Benin: Porto-Novo
- Bhutan: Thimphu
- Bolivia: La Paz (administrative); Sucre (judicial)
- Bosnia and Herzegovina: Sarajevo
- Botswana: Gaborone
- Brazil: Brasilia
- Brunei: Bandar Seri Begawan
- Bulgaria: Sofia
- Burkina Faso: Ouagadougou
- Burundi: Gitega (changed from Bujumbura in December 2018)
- Cambodia: Phnom Penh
- Cameroon: Yaounde
- Canada: Ottawa
- Cape Verde: Praia
- Central African Republic: Bangui
- Chad: N'Djamena
- Chile: Santiago
- China: Beijing
- Colombia: Bogota
- Comoros: Moroni
- Congo, Republic of the: Brazzaville
- Congo, Democratic Republic of the: Kinshasa
- Costa Rica: San Jose
- Cote d'Ivoire: Yamoussoukro (official); Abidjan (de facto)
- Croatia: Zagreb
- Cuba: Havana
- Cyprus: Nicosia
- Czech Republic: Prague
- Denmark: Copenhagen
- Djibouti: Djibouti
- Dominica: Roseau
- Dominican Republic: Santo Domingo
- East Timor (Timor-Leste): Dili
- Ecuador: Quito
- Egypt: Cairo
- El Salvador: San Salvador
- Equatorial Guinea: Malabo
- Eritrea: Asmara
- Estonia: Tallinn
- Ethiopia: Addis Ababa
- Fiji: Suva
- Finland: Helsinki
- France: Paris
- Gabon: Libreville
- The Gambia: Banjul
- Georgia: Tbilisi
- Germany: Berlin
- Ghana: Accra
- Greece: Athens
- Grenada: Saint George's
- Guatemala: Guatemala City
- Guinea: Conakry
- Guinea-Bissau: Bissau
- Guyana: Georgetown
- Haiti: Port-au-Prince
- Honduras: Tegucigalpa
- Hungary: Budapest
- Iceland: Reykjavik
- India: New Delhi
- Indonesia: Jakarta
- Iran: Tehran
- Iraq: Baghdad
- Ireland: Dublin
- Israel: Jerusalem*
- Italy: Rome
- Jamaica: Kingston
- Japan: Tokyo
- Jordan: Amman
- Kazakhstan: Astana
- Kenya: Nairobi
- Kiribati: Tarawa Atoll
- Korea, North: Pyongyang
- Korea, South: Seoul
- Kosovo: Pristina
- Kuwait: Kuwait City
- Kyrgyzstan: Bishkek
- Laos: Vientiane
- Latvia: Riga
- Lebanon: Beirut
- Lesotho: Maseru
- Liberia: Monrovia
- Libya: Tripoli
- Liechtenstein: Vaduz
- Lithuania: Vilnius
- Luxembourg: Luxembourg
- Macedonia: Skopje
- Madagascar: Antananarivo
- Malawi: Lilongwe
- Malaysia: Kuala Lumpur
- Maldives: Male
- Mali: Bamako
- Malta: Valletta
- Marshall Islands: Majuro
- Mauritania: Nouakchott
- Mauritius: Port Louis
- Mexico: Mexico City
- Micronesia, Federated States of: Palikir
- Moldova: Chisinau
- Monaco: Monaco
- Mongolia: Ulaanbaatar
- Montenegro: Podgorica
- Morocco: Rabat
- Mozambique: Maputo
- Myanmar (Burma): Rangoon (Yangon); Naypyidaw or Nay Pyi Taw (administrative)
- Namibia: Windhoek
- Nauru: no official capital; government offices in Yaren District
- Nepal: Kathmandu
- Netherlands: Amsterdam; The Hague (seat of government)
- New Zealand: Wellington
- Nicaragua: Managua
- Niger: Niamey
- Nigeria: Abuja
- Norway: Oslo
- Oman: Muscat
- Pakistan: Islamabad
- Palau: Melekeok
- Panama: Panama City
- Papua New Guinea: Port Moresby
- Paraguay: Asuncion
- Peru: Lima
- Philippines: Manila
- Poland: Warsaw
- Portugal: Lisbon
- Qatar: Doha
- Romania: Bucharest
- Russia: Moscow
- Rwanda: Kigali
- Saint Kitts and Nevis: Basseterre
- Saint Lucia: Castries
- Saint Vincent and the Grenadines: Kingstown
- Samoa: Apia
- San Marino: San Marino
- Sao Tome and Principe: Sao Tome
- Saudi Arabia: Riyadh
- Senegal: Dakar
- Serbia: Belgrade
- Seychelles: Victoria
- Sierra Leone: Freetown
- Singapore: Singapore
- Slovakia: Bratislava
- Slovenia: Ljubljana
- Solomon Islands: Honiara
- Somalia: Mogadishu
- South Africa: Pretoria (administrative); Cape Town (legislative); Bloemfontein (judiciary)
- South Sudan: Juba
- Spain: Madrid
- Sri Lanka: Colombo; Sri Jayewardenepura Kotte (legislative)
- Sudan: Khartoum
- Suriname: Paramaribo
- Swaziland: Mbabane
- Sweden: Stockholm
- Switzerland: Bern
- Syria: Damascus
- Taiwan: Taipei
- Tajikistan: Dushanbe
- Tanzania: Dar es Salaam; Dodoma (legislative)
- Thailand: Bangkok
- Togo: Lome
- Tonga: Nuku'alofa
- Trinidad and Tobago: Port-of-Spain
- Tunisia: Tunis
- Turkey: Ankara
- Turkmenistan: Ashgabat
- Tuvalu: Vaiaku village, Funafuti province
- Uganda: Kampala
- Ukraine: Kyiv
- United Arab Emirates: Abu Dhabi
- United Kingdom: London
- United States of America: Washington, D.C.
- Uruguay: Montevideo
- Uzbekistan: Tashkent
- Vanuatu: Port-Vila
- Vatican City (Holy See): Vatican City
- Venezuela: Caracas
- Vietnam: Hanoi
- Yemen: Sanaa
- Zambia: Lusaka
- Zimbabwe: Harare
Improve your GK
Confirmation Box - onClick in javascript program
Confirmation Box - onClick in javascript program:
<input id="confirm" type="button" value="Click me" onclick="confirm('Are you sure?');">
JavaScript program to print this page using onClick
Print this page on click in JavaScript program:
<input id="print" type="button" value="Print this Page" onclick="window.print();">
<input id="print" type="button" value="Print this Page" onclick="window.print();">
Javascript program to display alert box on click
Alert box on click in javascript program:
<input type="button" value="Click me" onclick="alert('Thanks for visiting my blog.....!');">
The multi threading concept in C++ with an example
The multi threading concept in C++ with an example:
#include
#include
using namespace std;
// function to be used in callable
void func_dummy(int N)
{
for (int i = 0; i < N; i++) {
cout << "Thread 1 :: callable => function pointer\n";
}
}
// A callable object
class thread_obj {
public:
void operator()(int n) {
for (int i = 0; i < n; i++)
cout << "Thread 2 :: callable => function object\n";
}
};
int main()
{
// Define a Lambda Expression
auto f = [](int n) {
for (int i = 0; i < n; i++)
cout << "Thread 3 :: callable => lambda expression\n";
};
//launch thread using function pointer as callable
thread th1(func_dummy, 2);
// launch thread using function object as callable
thread th2(thread_obj(), 2);
//launch thread using lambda expression as callable
thread th3(f, 2);
// Wait for thread t1 to finish
th1.join();
// Wait for thread t2 to finish
th2.join();
// Wait for thread t3 to finish
th3.join();
return 0;
}
Output:
Thread 1 :: callable => function pointer
Thread 1 :: callable => function pointer
Thread 3 :: callable => lambda expression
Thread 3 :: callable => lambda expression
Thread 2 :: callable => function object
Thread 2 :: callable => function object
#include
#include
using namespace std;
// function to be used in callable
void func_dummy(int N)
{
for (int i = 0; i < N; i++) {
cout << "Thread 1 :: callable => function pointer\n";
}
}
// A callable object
class thread_obj {
public:
void operator()(int n) {
for (int i = 0; i < n; i++)
cout << "Thread 2 :: callable => function object\n";
}
};
int main()
{
// Define a Lambda Expression
auto f = [](int n) {
for (int i = 0; i < n; i++)
cout << "Thread 3 :: callable => lambda expression\n";
};
//launch thread using function pointer as callable
thread th1(func_dummy, 2);
// launch thread using function object as callable
thread th2(thread_obj(), 2);
//launch thread using lambda expression as callable
thread th3(f, 2);
// Wait for thread t1 to finish
th1.join();
// Wait for thread t2 to finish
th2.join();
// Wait for thread t3 to finish
th3.join();
return 0;
}
Output:
Thread 1 :: callable => function pointer
Thread 1 :: callable => function pointer
Thread 3 :: callable => lambda expression
Thread 3 :: callable => lambda expression
Thread 2 :: callable => function object
Thread 2 :: callable => function object
Programming language : Ruby
Programming language : Ruby
Ruby is an interpreted, high-level, general-purpose programming language.
It was designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.
A dynamic, open source programming language with a focus on simplicity and productivity.
It has an elegant syntax that is natural to read and easy to write.
Platform support
Matsumoto originally did Ruby development on the 4.3BSD-based Sony NEWS-OS 3.x, but later migrated his work to SunOS 4.x, and finally to Linux.
Ruby versions and implementations are available on many operating systems, such as Linux, BSD, Solaris, AIX, macOS, Windows, Windows Phone,[104] Windows CE, Symbian OS, BeOS, and IBM i.
Features of Ruby:
1.Thoroughly object-oriented with inheritance, mixins and metaclasses
2.Dynamic typing and duck typing
3.Everything is an expression (even statements) and everything is executed imperatively (even declarations)
4.Succinct and flexible syntaxthat minimizes syntactic noise and serves as a foundation for domain-specific languages
5.Dynamic reflection and alteration of objects to facilitate metaprogramming
6.Lexical closures, iterators and generators, with a block syntax
7.Literal notation for arrays, hashes, regular expressions and symbols
8.Embedding code in strings (interpolation)
9.Default arguments
10.Four levels of variable scope (global, class, instance, and local) denoted by sigils or the lack thereof
11.Garbage collection
12.First-class continuations
13.Strict boolean coercion rules (everything is true except false and nil)
14.Exception handling
15.Operator overloading
16.Built-in support for rational numbers, complex numbers and arbitrary-precision arithmetic
17.Custom dispatch behavior (through method_missing and const_missing)
18.Native threads and cooperative fibers (fibers are a 1.9/YARV feature)
19.Support for Unicode and multiple character encodings.
20.Native plug-in API in C
21.Interactive Ruby Shell (a REPL)
22.Centralized package management through RubyGems
23.Implemented on all major platforms
24.Large standard library, including modules for YAML, JSON, XML, CGI, OpenSSL, HTTP, FTP, RSS, curses, zlib and Tk
Repositories and libraries:
RubyGems is Ruby's package manager. A Ruby package is called a "gem" and can easily be installed via the command line. Most gems are libraries, though a few exist that are applications, such as IDEs.
There are over 10,000 Ruby gems hosted on RubyGems.org.
Many new and existing Ruby libraries are hosted on GitHub, a service that offers version control repository hosting for Git.
The Ruby Application Archive, which hosted applications, documentation, and libraries for Ruby programming, was maintained until 2013, when its function was transferred to RubyGems.
Ruby is an interpreted, high-level, general-purpose programming language.
It was designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.
A dynamic, open source programming language with a focus on simplicity and productivity.
It has an elegant syntax that is natural to read and easy to write.
Platform support
Matsumoto originally did Ruby development on the 4.3BSD-based Sony NEWS-OS 3.x, but later migrated his work to SunOS 4.x, and finally to Linux.
Ruby versions and implementations are available on many operating systems, such as Linux, BSD, Solaris, AIX, macOS, Windows, Windows Phone,[104] Windows CE, Symbian OS, BeOS, and IBM i.
Features of Ruby:
1.Thoroughly object-oriented with inheritance, mixins and metaclasses
2.Dynamic typing and duck typing
3.Everything is an expression (even statements) and everything is executed imperatively (even declarations)
4.Succinct and flexible syntaxthat minimizes syntactic noise and serves as a foundation for domain-specific languages
5.Dynamic reflection and alteration of objects to facilitate metaprogramming
6.Lexical closures, iterators and generators, with a block syntax
7.Literal notation for arrays, hashes, regular expressions and symbols
8.Embedding code in strings (interpolation)
9.Default arguments
10.Four levels of variable scope (global, class, instance, and local) denoted by sigils or the lack thereof
11.Garbage collection
12.First-class continuations
13.Strict boolean coercion rules (everything is true except false and nil)
14.Exception handling
15.Operator overloading
16.Built-in support for rational numbers, complex numbers and arbitrary-precision arithmetic
17.Custom dispatch behavior (through method_missing and const_missing)
18.Native threads and cooperative fibers (fibers are a 1.9/YARV feature)
19.Support for Unicode and multiple character encodings.
20.Native plug-in API in C
21.Interactive Ruby Shell (a REPL)
22.Centralized package management through RubyGems
23.Implemented on all major platforms
24.Large standard library, including modules for YAML, JSON, XML, CGI, OpenSSL, HTTP, FTP, RSS, curses, zlib and Tk
Repositories and libraries:
RubyGems is Ruby's package manager. A Ruby package is called a "gem" and can easily be installed via the command line. Most gems are libraries, though a few exist that are applications, such as IDEs.
There are over 10,000 Ruby gems hosted on RubyGems.org.
Many new and existing Ruby libraries are hosted on GitHub, a service that offers version control repository hosting for Git.
The Ruby Application Archive, which hosted applications, documentation, and libraries for Ruby programming, was maintained until 2013, when its function was transferred to RubyGems.
Date and time java script program
<!DOCTYPE html>
<title>Time and Date</title>
<time id="msg"></time>
<script>
document.getElementById("msg").innerHTML = new Date().toLocaleString();
</script>
<title>Time and Date</title>
<time id="msg"></time>
<script>
document.getElementById("msg").innerHTML = new Date().toLocaleString();
</script>
JavaScript program to create a JavaScript object to show the current time
<!DOCTYPE html>
<title>Current time</title>
<time id="time"></time>
<script language="javascript">
/*Create a JavaScript object for the current time,then extract the desired parts, then join them again in the desired format.*/
var currentTime = new Date(),
hours = currentTime.getHours(),
minutes = currentTime.getMinutes();
if (minutes < 10) {
minutes = "0" + minutes;
}
var suffix = "AM";
if (hours >= 12) {
suffix = "PM";
hours = hours - 12;
}
if (hours == 0) {
hours = 12;
}
time = hours + ":" + minutes + " " + suffix;
// Output
document.getElementById("time").innerHTML = time;
</script>
<title>Current time</title>
<time id="time"></time>
<script language="javascript">
/*Create a JavaScript object for the current time,then extract the desired parts, then join them again in the desired format.*/
var currentTime = new Date(),
hours = currentTime.getHours(),
minutes = currentTime.getMinutes();
if (minutes < 10) {
minutes = "0" + minutes;
}
var suffix = "AM";
if (hours >= 12) {
suffix = "PM";
hours = hours - 12;
}
if (hours == 0) {
hours = 12;
}
time = hours + ":" + minutes + " " + suffix;
// Output
document.getElementById("time").innerHTML = time;
</script>
JavaScript program for multiplication table
<html>
<head>
<title>Multiplication Table</title>
<script type="text/javascript">
var rows = prompt("How many rows for your multiplication table?");
var cols = prompt("How many columns for your multiplication table?");
if(rows == "" || rows == null)
rows = 10;
if(cols== "" || cols== null)
cols = 10;
createTable(rows, cols);
function createTable(rows, cols)
{
var j=1;
var output = "<table border='1' width='500' cellspacing='0'cellpadding='5'>";
for(i=1;i<=rows;i++)
{
output = output + "<tr>";
while(j<=cols)
{
output = output + "<td>" + i*j + "</td>";
j = j+1;
}
output = output + "</tr>";
j = 1;
}
output = output + "</table>";
document.write(output);
}
</script>
</head>
<body>
</body>
</html>
<head>
<title>Multiplication Table</title>
<script type="text/javascript">
var rows = prompt("How many rows for your multiplication table?");
var cols = prompt("How many columns for your multiplication table?");
if(rows == "" || rows == null)
rows = 10;
if(cols== "" || cols== null)
cols = 10;
createTable(rows, cols);
function createTable(rows, cols)
{
var j=1;
var output = "<table border='1' width='500' cellspacing='0'cellpadding='5'>";
for(i=1;i<=rows;i++)
{
output = output + "<tr>";
while(j<=cols)
{
output = output + "<td>" + i*j + "</td>";
j = j+1;
}
output = output + "</tr>";
j = 1;
}
output = output + "</table>";
document.write(output);
}
</script>
</head>
<body>
</body>
</html>
Monday, December 16, 2019
C program solved practical slips of F.Y.B.Sc. Computer Science Laboratory Course I & II
C program solved practical slips of F.Y.B.Sc. Computer Science Laboratory Course I & II:
Program no: 6
Title:To demonstrate the use of library functions
#include
#include
#include
void main()
{
int n,x;
float s,c,l,sqr,expo;
clrscr();
printf("\n Enter the number:");
scanf("%d",&n);
do
{
printf("\n Select any of the following operations:");
printf("\n 1.Sine");
printf("\n 2.Cosine");
printf("\n 3.Log");
printf("\n 4.Exponential");
printf("\n 5.Squareroot");
printf("\n 6.Exit\t");
scanf("%d",&x);
switch(x)
{
case 1:s=sin(n);
printf("\n Sine= %f",s);
break;
case 2:c=cos(n);
printf("\n Cosine= %f",c);
break;
case 3:l=log(n);
printf("\n Log= %f",l);
break;
case 4:expo=exp(n);
printf("\n Exponential= %f",expo);
break;
case 5:sqr=sqrt(n);
printf("\n Squareroot= %f",sqr);
break;
case 6:break;
default:printf("\n Invalid choice ");
break;
}
}while(x!=6);
getch();
}
Output:
Enter the number:4
Select any of the following operations:
1.Sine
2.Cosine
3.Log
4.Exponential
5.Squareroot
6.Exit 2
Cosine = -0.6536
Select any of the following operations:
1.Sine
2.Cosine
3.Log
4.Exponential
5.Squareroot
6.Exit
Program no: 7
Title:To demonstratethe use of functions
#include
#include
void prime();
void main()
{
clrscr();
prime();
getch();
}
void prime()
{
int num,temp=0,i,j=1,ct=0,n=0,a=1;
printf("\nEnter a number:");
scanf("%d",&num);
if(num>0)
{
for(i=2;i{
if(num%i==0)
{
printf("\n not a prime number");
temp=1;
break;
}
}
if(temp==0)
printf("\n it is a prime number");
}
while(n<10 p="">{
j=1;
ct=0;
while(j<=a)
{
if(a%j==0)
ct++;
j++;
}
if(ct==2)
printf("\n\n%d",a);
n++;
}
a++;
}
}
Output:
Enter a prime number: 5
It is a prime number
2
3
5
7
11
13
17
19
23
29
Program no: 8
Title:To demonstrate the use of one dimenstional array
#include
#include
void occur();
void main()
{
clrscr();
occur();
getch();
}
void occur()
{
int a[25],i,n,count=0,x;
printf(“\n Enter number of elements:”);
scanf(“%d”,&n);
printf(“\n Enter elements for array:\n “);
for(i=0;i<=n-1;i++)
{
scanf(“%d”,&a[i]);
}
printf(“\n Enter number to check the frequency of occurrence:”);
scanf(“%d”,&x);
for(i=0;i<=n-1;i++)
{
if(a[i]==x)
count++;
}
printf(“\n The frequency of occurrence is %d”,count);
}
Output:
Enter number of elements: 5
Enter elements for array:
2
1
3
4
5
5
The frequency of occurrence is 2
Program no: 9
Title:To demonstrate the use of two dimenstional array
#include
#include
void trans();
void main()
{
clrscr();
trans();
getch();
}
void trans()
{
int a[20][20],i,j,m,n;
printf("\n Enter the number of rows and columns:");
scanf("%d\t%d",&m,&n);
printf("\n Enter elements for matrix:\n");
for(i=0;i<=m-1;i++)
{
for(j=0;j<=n-1;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n Transpose of matrix is:\n");
for(i=0;i<=n-1;i++)
{
for(j=0;j<=m-1;j++)
{
printf("%d",a[j][i]);
}
printf("\n");
}
}
Output:
Enter the number of rows and columns: 3 3
Enter elements for matrix:
2
3
4
5
6
7
8
9
1
Transpose of matrix is:
2 5 8
3 6 9
4 7 1
10>
Program no: 6
Title:To demonstrate the use of library functions
#include
#include
#include
void main()
{
int n,x;
float s,c,l,sqr,expo;
clrscr();
printf("\n Enter the number:");
scanf("%d",&n);
do
{
printf("\n Select any of the following operations:");
printf("\n 1.Sine");
printf("\n 2.Cosine");
printf("\n 3.Log");
printf("\n 4.Exponential");
printf("\n 5.Squareroot");
printf("\n 6.Exit\t");
scanf("%d",&x);
switch(x)
{
case 1:s=sin(n);
printf("\n Sine= %f",s);
break;
case 2:c=cos(n);
printf("\n Cosine= %f",c);
break;
case 3:l=log(n);
printf("\n Log= %f",l);
break;
case 4:expo=exp(n);
printf("\n Exponential= %f",expo);
break;
case 5:sqr=sqrt(n);
printf("\n Squareroot= %f",sqr);
break;
case 6:break;
default:printf("\n Invalid choice ");
break;
}
}while(x!=6);
getch();
}
Output:
Enter the number:4
Select any of the following operations:
1.Sine
2.Cosine
3.Log
4.Exponential
5.Squareroot
6.Exit 2
Cosine = -0.6536
Select any of the following operations:
1.Sine
2.Cosine
3.Log
4.Exponential
5.Squareroot
6.Exit
Program no: 7
Title:To demonstratethe use of functions
#include
#include
void prime();
void main()
{
clrscr();
prime();
getch();
}
void prime()
{
int num,temp=0,i,j=1,ct=0,n=0,a=1;
printf("\nEnter a number:");
scanf("%d",&num);
if(num>0)
{
for(i=2;i
if(num%i==0)
{
printf("\n not a prime number");
temp=1;
break;
}
}
if(temp==0)
printf("\n it is a prime number");
}
while(n<10 p="">{
j=1;
ct=0;
while(j<=a)
{
if(a%j==0)
ct++;
j++;
}
if(ct==2)
printf("\n\n%d",a);
n++;
}
a++;
}
}
Output:
Enter a prime number: 5
It is a prime number
2
3
5
7
11
13
17
19
23
29
Program no: 8
Title:To demonstrate the use of one dimenstional array
#include
#include
void occur();
void main()
{
clrscr();
occur();
getch();
}
void occur()
{
int a[25],i,n,count=0,x;
printf(“\n Enter number of elements:”);
scanf(“%d”,&n);
printf(“\n Enter elements for array:\n “);
for(i=0;i<=n-1;i++)
{
scanf(“%d”,&a[i]);
}
printf(“\n Enter number to check the frequency of occurrence:”);
scanf(“%d”,&x);
for(i=0;i<=n-1;i++)
{
if(a[i]==x)
count++;
}
printf(“\n The frequency of occurrence is %d”,count);
}
Output:
Enter number of elements: 5
Enter elements for array:
2
1
3
4
5
5
The frequency of occurrence is 2
Program no: 9
Title:To demonstrate the use of two dimenstional array
#include
#include
void trans();
void main()
{
clrscr();
trans();
getch();
}
void trans()
{
int a[20][20],i,j,m,n;
printf("\n Enter the number of rows and columns:");
scanf("%d\t%d",&m,&n);
printf("\n Enter elements for matrix:\n");
for(i=0;i<=m-1;i++)
{
for(j=0;j<=n-1;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n Transpose of matrix is:\n");
for(i=0;i<=n-1;i++)
{
for(j=0;j<=m-1;j++)
{
printf("%d",a[j][i]);
}
printf("\n");
}
}
Output:
Enter the number of rows and columns: 3 3
Enter elements for matrix:
2
3
4
5
6
7
8
9
1
Transpose of matrix is:
2 5 8
3 6 9
4 7 1
10>
C solved practical slips of F.Y.B.Sc. Computer Science
C solved practical slips of F.Y.B.Sc. Computer Science:
Program 1:
Title:To demonstrate the use of data types and simple operators
#include
#include
void main()
{
float fahr,cel=0,kel=0;
clrscr();
printf(“\n Enter temperature in Fahrenheit:”);
scanf(“%f”,&fahr);
cel=((5.0/9)*(fahr-32));
kel=cel+273.15;
printf(“\n Temperature in 1 elsius is %0.2f”,cel);
printf(“\n Temperature in kelvin is %0.2f”,kel);
getch();
}
Output:
Enter the temperature in Fahrenheit:50
Temperature in Celsius is 10.00
Temperature in Kelvin is 283.15
Program no: 2
Title:To demonstrate the use of if, if-else statements
#include
#include
void main()
{
int year;
clrscr();
printf(“\n Enter the year:”);
scanf(“%d”,&year);
if(year%4==0 && year%10!=0 || year%400==0)
printf(“\n %d is leap year”,year);
else
printf(“\n %d is not leap year”,year);
getch();
}
Output:
Enter the year:1994
1994 is not leap year
Enter the year:2004
2004 is leap year
Program no: 3
Title:To demonstrate the use of switch case
#include
#include
void main()
{
int n;
float rad;
clrscr();
printf(“\n Enter the radius:”);
scanf(“%f”,&rad);
printf(“\n Enter your choice:”);
printf(“\n 1.Area of circle”);
printf(“\n 2.Circumference of circle \n 3.Volume of circle:\t”);
scanf(“%d”,&n);
switch(n)
{
case 1:printf(“\n Area of circle=%0.2f”,3.14*rad*rad);
break;
case 2:printf(“\n Circumference of circle=%02f”,2*3.14*rad);
break;
case 3:printf(“\n Volume of of circle=%0.2f”,1.334*3.14*rad*rad*rad);
break;
default:printf(“Invalid choice”);
}
getch();
}
Output:
Enter radius:2
Enter your choice:
1. Area of circle
2. Circumference of circle
3. Volume of circle
Entre your choice:1
1. Area of circle: 12.56
Program no: 4
Title:To demonstrate the use ofloops
#include
#include
void main()
{
int n,a=1,b=1,c;
clrscr();
printf(“\n Enter the last number:”);
scanf(“%d”,&n);
printf(“\n Fibnoacci series is:\t%d\t%d”,a,b);
do
{
c=a+b;
printf(“\t%d”,c);
a=b; b=c;
}while(c<=n);
getch();
}
Output:
Enter the last number:50
Fibnoacci series is:1 1 2 3 5 8 13 21 34 55
Program no: 5
Title:To demonstrate the use of looping structures
#include
#include
void main()
{
int a,b,c,sum=0,x;
clrscr();
printf(“\n The Armstrong number between the range 1 & 500 are:\n”);
for(x=1;x<=500;x++)
{
a=x; sum=0;
do
{
b=a%10;
sum+=(b*b*b);
a=a/10;
}while(a!=0);
if(sum==x)
printf(“\t%d”,x);
}
getch();
}
Output:
The Armstrong number between the range 1 & 500 are:
1 153 370 371 407
Program 1:
Title:To demonstrate the use of data types and simple operators
#include
#include
void main()
{
float fahr,cel=0,kel=0;
clrscr();
printf(“\n Enter temperature in Fahrenheit:”);
scanf(“%f”,&fahr);
cel=((5.0/9)*(fahr-32));
kel=cel+273.15;
printf(“\n Temperature in 1 elsius is %0.2f”,cel);
printf(“\n Temperature in kelvin is %0.2f”,kel);
getch();
}
Output:
Enter the temperature in Fahrenheit:50
Temperature in Celsius is 10.00
Temperature in Kelvin is 283.15
Program no: 2
Title:To demonstrate the use of if, if-else statements
#include
#include
void main()
{
int year;
clrscr();
printf(“\n Enter the year:”);
scanf(“%d”,&year);
if(year%4==0 && year%10!=0 || year%400==0)
printf(“\n %d is leap year”,year);
else
printf(“\n %d is not leap year”,year);
getch();
}
Output:
Enter the year:1994
1994 is not leap year
Enter the year:2004
2004 is leap year
Program no: 3
Title:To demonstrate the use of switch case
#include
#include
void main()
{
int n;
float rad;
clrscr();
printf(“\n Enter the radius:”);
scanf(“%f”,&rad);
printf(“\n Enter your choice:”);
printf(“\n 1.Area of circle”);
printf(“\n 2.Circumference of circle \n 3.Volume of circle:\t”);
scanf(“%d”,&n);
switch(n)
{
case 1:printf(“\n Area of circle=%0.2f”,3.14*rad*rad);
break;
case 2:printf(“\n Circumference of circle=%02f”,2*3.14*rad);
break;
case 3:printf(“\n Volume of of circle=%0.2f”,1.334*3.14*rad*rad*rad);
break;
default:printf(“Invalid choice”);
}
getch();
}
Output:
Enter radius:2
Enter your choice:
1. Area of circle
2. Circumference of circle
3. Volume of circle
Entre your choice:1
1. Area of circle: 12.56
Program no: 4
Title:To demonstrate the use ofloops
#include
#include
void main()
{
int n,a=1,b=1,c;
clrscr();
printf(“\n Enter the last number:”);
scanf(“%d”,&n);
printf(“\n Fibnoacci series is:\t%d\t%d”,a,b);
do
{
c=a+b;
printf(“\t%d”,c);
a=b; b=c;
}while(c<=n);
getch();
}
Output:
Enter the last number:50
Fibnoacci series is:1 1 2 3 5 8 13 21 34 55
Program no: 5
Title:To demonstrate the use of looping structures
#include
#include
void main()
{
int a,b,c,sum=0,x;
clrscr();
printf(“\n The Armstrong number between the range 1 & 500 are:\n”);
for(x=1;x<=500;x++)
{
a=x; sum=0;
do
{
b=a%10;
sum+=(b*b*b);
a=a/10;
}while(a!=0);
if(sum==x)
printf(“\t%d”,x);
}
getch();
}
Output:
The Armstrong number between the range 1 & 500 are:
1 153 370 371 407
Study testing conditions: if, elif, else in python
Testing conditions: if, elif, else :
In Python, we have the if, elif and the else statements for decision making to execute a certain line of codes if a condition is satisfied,and a different set of code in case it is not.
This is the simplest example of a conditional statement. The syntax is:
if(condition):
indented Statement Block
The block of lines indented the same amount after the colon (:) will be executed whenever the condition is TRUE.
For example, lets say you are recording the score for a certain course.
The total score is 100, with 50 points for the theoretical work and 50 for practical.
You want to display an error message or warning if the score exceeds 100.
score_theory = 40
score_practical = 45
if(score_theory + score_practical > 100):
print("Invalid score. Please check the input.")
The colon (:) is important because it separates the condition from the statements to be executed after the evaluation of the condition.
The above if statement checks for the 'if' condition and determines the statement
(40 + 45 = 85) > 100 to be FALSE and thus, will not print the warning.
Lets make the statement FALSE and see what happens:
score_theory = 50
score_practical = 55
if(score_theory + score_practical >= 100):
print("Invalid score. Please check the input.")
Output:
Invalid score. Please check the input.
if-else Statement
The syntax for the if-else statement is:
if(condition):
Indented statement block for when condition is TRUE
else:
Indented statement block for when condition is FALSE
example:
score_theory = 40
score_practical = 45
if(score_theory + score_practical > 100):
print("Please check the input. Score exceeds total possible score.")
else:
print("Score validated. Your total is: ", score_theory + score_practical)
Output:
Score validated. Your total is: 85
Multiple tests: if-elif-else Statement:
The syntax followed by the if-else-if statement is:
if(Condition1):
Indented statement block for Condition1
elif(Condition2):
Indented statement block for Condition2
else:
Alternate statement block if all condition check above fails
Example:
coursework = "English"
score_theory = 53
score_practical = 35
if(coursework == "Science" or coursework == "science"):
if(score_theory > 50):
print("Please check the input score for 'Science: Theory'.")
elif(score_practical > 50):
print("Please check the input score for 'Science: Practical'.")
else:
print("Score validated for Science. Your total is: ",score_theory + score_practical)
elif(coursework == "English" or coursework == "english"):
if(score_theory > 60):
print("Please check the input score for 'English: Theory'.")
elif(score_practical > 40):
print("Please check the input score for 'English: Practical'.")
else:
print("Score validated for English. Your total is: ",score_theory + score_practical)
else: print("Coursework not recognized. Please enter score for either Science or English.")
Output:
Score validated for English. Your total is: 88
In Python, we have the if, elif and the else statements for decision making to execute a certain line of codes if a condition is satisfied,and a different set of code in case it is not.
This is the simplest example of a conditional statement. The syntax is:
if(condition):
indented Statement Block
The block of lines indented the same amount after the colon (:) will be executed whenever the condition is TRUE.
For example, lets say you are recording the score for a certain course.
The total score is 100, with 50 points for the theoretical work and 50 for practical.
You want to display an error message or warning if the score exceeds 100.
score_theory = 40
score_practical = 45
if(score_theory + score_practical > 100):
print("Invalid score. Please check the input.")
The colon (:) is important because it separates the condition from the statements to be executed after the evaluation of the condition.
The above if statement checks for the 'if' condition and determines the statement
(40 + 45 = 85) > 100 to be FALSE and thus, will not print the warning.
Lets make the statement FALSE and see what happens:
score_theory = 50
score_practical = 55
if(score_theory + score_practical >= 100):
print("Invalid score. Please check the input.")
Output:
Invalid score. Please check the input.
if-else Statement
The syntax for the if-else statement is:
if(condition):
Indented statement block for when condition is TRUE
else:
Indented statement block for when condition is FALSE
example:
score_theory = 40
score_practical = 45
if(score_theory + score_practical > 100):
print("Please check the input. Score exceeds total possible score.")
else:
print("Score validated. Your total is: ", score_theory + score_practical)
Output:
Score validated. Your total is: 85
Multiple tests: if-elif-else Statement:
The syntax followed by the if-else-if statement is:
if(Condition1):
Indented statement block for Condition1
elif(Condition2):
Indented statement block for Condition2
else:
Alternate statement block if all condition check above fails
Example:
coursework = "English"
score_theory = 53
score_practical = 35
if(coursework == "Science" or coursework == "science"):
if(score_theory > 50):
print("Please check the input score for 'Science: Theory'.")
elif(score_practical > 50):
print("Please check the input score for 'Science: Practical'.")
else:
print("Score validated for Science. Your total is: ",score_theory + score_practical)
elif(coursework == "English" or coursework == "english"):
if(score_theory > 60):
print("Please check the input score for 'English: Theory'.")
elif(score_practical > 40):
print("Please check the input score for 'English: Practical'.")
else:
print("Score validated for English. Your total is: ",score_theory + score_practical)
else: print("Coursework not recognized. Please enter score for either Science or English.")
Output:
Score validated for English. Your total is: 88
Variables and objects in python
Learn variables and objects in python:
In Python, values are stored in objects.
If we do
d = 10.0
a new object d is created. As we have given it a floating point value (10.0) the object is of type floating point.
If we had defined d = 10, d would have been an integer object.
In other programming languages, values are stored in variables.
This is not exactly the same as an object, as an object has "methods", that means functions that belong to the object.
There are many object types in Python.
The most important to begin with are:
Object type: Integer
Type class name: int
Description: Signed integer, 32 bit
Example: a = 5
Object type: Float
Type class name: float
Description: Double precision floating point number, 64 bit
Example:b = 3.14
Object type: Complex
Type class name: complex
Description: Complex number
Example: c = 3 + 5j
c= complex(3,5)
Object type: Character
Type class name: chr
Description: Single byte character
Example: d = chr(65)
d = 'A'
d = "A"
Object type: String
Type class name: str
Description: List of characters, text string
Example: e = 'LTAM'
e = "LTAM"
In Python, values are stored in objects.
If we do
d = 10.0
a new object d is created. As we have given it a floating point value (10.0) the object is of type floating point.
If we had defined d = 10, d would have been an integer object.
In other programming languages, values are stored in variables.
This is not exactly the same as an object, as an object has "methods", that means functions that belong to the object.
There are many object types in Python.
The most important to begin with are:
Object type: Integer
Type class name: int
Description: Signed integer, 32 bit
Example: a = 5
Object type: Float
Type class name: float
Description: Double precision floating point number, 64 bit
Example:b = 3.14
Object type: Complex
Type class name: complex
Description: Complex number
Example: c = 3 + 5j
c= complex(3,5)
Object type: Character
Type class name: chr
Description: Single byte character
Example: d = chr(65)
d = 'A'
d = "A"
Object type: String
Type class name: str
Description: List of characters, text string
Example: e = 'LTAM'
e = "LTAM"
A python program to ask the user for his name and greets him
Write a python program to ask the user for his name and greets him:
Answer:
s = raw_input("What is your name?")
print "HELLO ", s
Output:
What is your name?Tom
HELLO Tom
Answer:
s = raw_input("What is your name?")
print "HELLO ", s
Output:
What is your name?Tom
HELLO Tom
A python program to draw hexagon using Turtle Programming
Write a python program to draw hexagon using Turtle Programming :
Answer:
import turtle
polygon = turtle.Turtle()
num_sides = 6
side_length = 70
angle = 360.0 / num_sides
for i in range(num_sides):
polygon.forward(side_length)
polygon.right(angle)
turtle.done()
Answer:
import turtle
polygon = turtle.Turtle()
num_sides = 6
side_length = 70
angle = 360.0 / num_sides
for i in range(num_sides):
polygon.forward(side_length)
polygon.right(angle)
turtle.done()
A python program to draw star using Turtle Programming
Write a python program to draw star using Turtle Programming :
Answer:
import turtle
star = turtle.Turtle()
for i in range(50):
star.forward(50)
star.right(144)
turtle.done()
Answer:
import turtle
star = turtle.Turtle()
for i in range(50):
star.forward(50)
star.right(144)
turtle.done()
A python program to draw square using Turtle Programming
Write a python program to draw square using Turtle Programming
Answer:
import turtle
skk = turtle.Turtle()
for i in range(4):
skk.forward(50)
skk.right(90)
turtle.done()
Answer:
import turtle
skk = turtle.Turtle()
for i in range(4):
skk.forward(50)
skk.right(90)
turtle.done()
Python program to demonstrate all stack operations using a doubly linked list
Write a python program to demonstrate all stack operations using a doubly linked list :
Answer:
class Node:
def __init__(self, data):
self.data = data # Assign data
self.next = None # Initialize next as null
self.prev = None # Initialize prev as null
class Stack:
# Function to initialize head
def __init__(self):
self.head = None
def push(self, data):
if self.head is None:
self.head = Node(data)
else:
new_node = Node(data)
self.head.prev = new_node
new_node.next = self.head
new_node.prev = None
self.head = new_node
def pop(self):
if self.head is None:
return None
else:
temp = self.head.data
self.head = self.head.next
self.head.prev = None
return temp
def top(self):
return self.head.data
def size(self):
temp = self.head
count = 0
while temp is not None:
count = count + 1
temp = temp.next
return count
def isEmpty(self):
if self.head is None:
return True
else:
return False
def printstack(self):
print("stack elements are:")
temp = self.head
while temp is not None:
print(temp.data, end ="->")
temp = temp.next
if __name__=='__main__':
stack = Stack()
print("Stack operations using Doubly LinkedList")
stack.push(4)
stack.push(5)
stack.push(6)
stack.push(7)
stack.printstack()
print("\nTop element is ", stack.top())
print("Size of the stack is ", stack.size())
stack.pop()
stack.pop()
stack.printstack()
print("\nstack is empty:", stack.isEmpty())
Output:
Stack operations using Doubly LinkedList
stack elements are:
7->6->5->4->
Top element is 7
Size of the stack is 4
stack elements are:
5->4->
stack is empty: False
Answer:
class Node:
def __init__(self, data):
self.data = data # Assign data
self.next = None # Initialize next as null
self.prev = None # Initialize prev as null
class Stack:
# Function to initialize head
def __init__(self):
self.head = None
def push(self, data):
if self.head is None:
self.head = Node(data)
else:
new_node = Node(data)
self.head.prev = new_node
new_node.next = self.head
new_node.prev = None
self.head = new_node
def pop(self):
if self.head is None:
return None
else:
temp = self.head.data
self.head = self.head.next
self.head.prev = None
return temp
def top(self):
return self.head.data
def size(self):
temp = self.head
count = 0
while temp is not None:
count = count + 1
temp = temp.next
return count
def isEmpty(self):
if self.head is None:
return True
else:
return False
def printstack(self):
print("stack elements are:")
temp = self.head
while temp is not None:
print(temp.data, end ="->")
temp = temp.next
if __name__=='__main__':
stack = Stack()
print("Stack operations using Doubly LinkedList")
stack.push(4)
stack.push(5)
stack.push(6)
stack.push(7)
stack.printstack()
print("\nTop element is ", stack.top())
print("Size of the stack is ", stack.size())
stack.pop()
stack.pop()
stack.printstack()
print("\nstack is empty:", stack.isEmpty())
Output:
Stack operations using Doubly LinkedList
stack elements are:
7->6->5->4->
Top element is 7
Size of the stack is 4
stack elements are:
5->4->
stack is empty: False
Python program to create a list of tuples from given list having number and its cube in each tuple
Write a python program to create a list of tuples from given list having number and its cube in each tuple:
Answer:
list1 = [1, 2, 7, 8]
res = [(val, pow(val, 3)) for val in list1]
print(res)
Output:
[(1, 1), (2, 8), (7, 343), (8, 512)]
Answer:
list1 = [1, 2, 7, 8]
res = [(val, pow(val, 3)) for val in list1]
print(res)
Output:
[(1, 1), (2, 8), (7, 343), (8, 512)]
Saturday, December 14, 2019
Break bulk cargo
Break bulk cargo :
Break bulk cargo is transported in bags, boxes, crates, drums, or barrels. Unit loads of items secured to a pallet or skid are also used, break bulk cargo or general cargo are goods that must be loaded individually, and not in inter-modal containers nor in bulk as with oil or grain. Ships that carry this sort of cargo are called general cargo ships.
There are many sorts of break bulk cargo but among them are:
Bagged cargo:
Bagged cargo (e.g. coffee in sacks) is stowed on double dunned and kept clear of the ship's sides and bulk heads.
Bags are kept away from pillars and stanchions by covering it with matting or waterproof paper.
Baled goods:
Baled goods are stowed on single dunnage at least 50 mm (1.97 in) thick. The bales must be clean with all the bands intact.
Stained or oily bales are rejected. All fibers can absorb oil and are liable to spontaneous combustion.
As a result, they are kept clear of any new paintwork. Bales close to the deckhead are covered to prevent damage by dripping sweat.
Barrels and casks:
Wooden barrels are stowed on their sides on "beds" of dunnage which keeps the middle of the side (the bilge) off the deck and they are stowed with the bung at the top.
To prevent movement, wedges called quoins are put in on top of the "beds".
Barrels should be stowed fore and aft and not athwart ships.
Once the first tier has been loaded the next tier of barrels fits into the hollows between the barrels, this is known as stowing "bilge and cant-line".
Barrels which are also known as casks or tuns are primarily use for transporting liquids such as wine, water, brandy, whiskey, and even oil.
They are usually built in spherical shape to make it easier to roll and have less friction when changing direction.
Corrugated boxes:
Corrugated box design is the process of matching design factors for corrugated fiberboard boxes with the functional physical, processing and end-use requirements.
Packaging engineers work to meet the performance requirements of a box while controlling total costs throughout the system.
Corrugated boxes are stowed on a good layer of dunnage and kept clear of any moisture.
Military and weather-resistant grades of corrugated fiberboard are available.
They are not over-stowed with anything other than similar boxes.
They are frequently loaded on pallets to form a unit load; if so the slings that are used to load the cargo are frequently left on to facilitate discharge.
Wooden shipping containers:
Wooden boxes or crates are stowed on double dunnage in the holds and single dunnage in the 'tween decks. Heavy boxes are given bottom stowage.
The loading slings are often left on to aid discharge.
Drums:
Metal drums are stowed on end with dunnage between tiers, in the longitudinal space of the ship
Paper reels:
Reels or rolls are generally stowed on their sides and care is taken to make sure they are not crushed.
Motor vehicles:
Automobiles are lifted on board and then secured using lashings. Great care is taken to prevent damage.
Vehicles are prepared by removing hazardous liquids (gasoline, etc.).
This is in contrast to ro-ro (roll-on/roll-off) vessels where vehicles are driven on and off the ship under their own power.
Steel girders:
Any long heavy items are stowed fore and aft. If they are stowed athwart ships they are liable to shift if the ship rolls heavily and pierce the side of the ship.
Break bulk cargo is transported in bags, boxes, crates, drums, or barrels. Unit loads of items secured to a pallet or skid are also used, break bulk cargo or general cargo are goods that must be loaded individually, and not in inter-modal containers nor in bulk as with oil or grain. Ships that carry this sort of cargo are called general cargo ships.
There are many sorts of break bulk cargo but among them are:
Bagged cargo:
Bagged cargo (e.g. coffee in sacks) is stowed on double dunned and kept clear of the ship's sides and bulk heads.
Bags are kept away from pillars and stanchions by covering it with matting or waterproof paper.
Baled goods:
Baled goods are stowed on single dunnage at least 50 mm (1.97 in) thick. The bales must be clean with all the bands intact.
Stained or oily bales are rejected. All fibers can absorb oil and are liable to spontaneous combustion.
As a result, they are kept clear of any new paintwork. Bales close to the deckhead are covered to prevent damage by dripping sweat.
Barrels and casks:
Wooden barrels are stowed on their sides on "beds" of dunnage which keeps the middle of the side (the bilge) off the deck and they are stowed with the bung at the top.
To prevent movement, wedges called quoins are put in on top of the "beds".
Barrels should be stowed fore and aft and not athwart ships.
Once the first tier has been loaded the next tier of barrels fits into the hollows between the barrels, this is known as stowing "bilge and cant-line".
Barrels which are also known as casks or tuns are primarily use for transporting liquids such as wine, water, brandy, whiskey, and even oil.
They are usually built in spherical shape to make it easier to roll and have less friction when changing direction.
Corrugated boxes:
Corrugated box design is the process of matching design factors for corrugated fiberboard boxes with the functional physical, processing and end-use requirements.
Packaging engineers work to meet the performance requirements of a box while controlling total costs throughout the system.
Corrugated boxes are stowed on a good layer of dunnage and kept clear of any moisture.
Military and weather-resistant grades of corrugated fiberboard are available.
They are not over-stowed with anything other than similar boxes.
They are frequently loaded on pallets to form a unit load; if so the slings that are used to load the cargo are frequently left on to facilitate discharge.
Wooden shipping containers:
Wooden boxes or crates are stowed on double dunnage in the holds and single dunnage in the 'tween decks. Heavy boxes are given bottom stowage.
The loading slings are often left on to aid discharge.
Drums:
Metal drums are stowed on end with dunnage between tiers, in the longitudinal space of the ship
Paper reels:
Reels or rolls are generally stowed on their sides and care is taken to make sure they are not crushed.
Motor vehicles:
Automobiles are lifted on board and then secured using lashings. Great care is taken to prevent damage.
Vehicles are prepared by removing hazardous liquids (gasoline, etc.).
This is in contrast to ro-ro (roll-on/roll-off) vessels where vehicles are driven on and off the ship under their own power.
Steel girders:
Any long heavy items are stowed fore and aft. If they are stowed athwart ships they are liable to shift if the ship rolls heavily and pierce the side of the ship.
Cargo - Transportation - Mode of transport - Freight
Cargo meaning, goods carried on a ship, aircraft, or motor vehicle, which is the transportation of bulk cargo.
Transportation is used for moving of people, animals, and other goods from one place to another.
List of cargo types:
1. Break bulk cargo or General cargo
2. Bulk cargo (Bulk dry cargo)
3. Bulk liquid cargo
4. Container cargo
5. Neo-bulk cargo
6. Passenger cargo
7. Project cargo
8. Refrigerated cargo
9. Roll-on/roll-off cargo
Break Bulk:
Concerns cargo that is carried in drums, bags, pallets or boxes. Such ships are typically geared.
Neo Bulk:
Concerns cargo where each pre-packaged unit is accountable such as lumber (bundles), paper (rolls), steel and vehicles.
Containerized:
The growth of container shipping required the creation of a new general cargo category where the cargo is being carried in container load units.
Liquid bulk:
The majority of the liquid bulk being carried is petroleum LNG (Liquefied Natural Gas) represents an emerging segment.
Liquid bulk ships are commonly referred as tankers.
Dry Bulk:
Concerns a wide variety of materials such as coal, iron ore, grains bauxite and sand.
The term cargo is also used in case of goods in the cold-chain,
because the perishable inventory is always in transit towards a final end-use,
even when it is held in cold storage or other similar climate-controlled facility.
The term freight is commonly used to describe the movements of flows of goods being transported by any mode of transportation.
The means of transport, on the other hand, refers to the vehicles necessary for transport according to the chosen mode i.e. airplane, ship, truck and rail.
Each mode of transport has a fundamentally different technological solution, and some require a separate environment.
Each mode has its own infrastructure, vehicles, and operations.
Mode of transport:
Mode of transport is a term used to distinguish between different ways of transportation or transporting people or goods.
The different modes of transport are
1. Air,
2. Water,and
3. Land transport, which includes Rails or railways, road and off-road transport.
Other modes also exist, including pipelines, cable transport, and space transport.
Human-powered transport and animal-powered transport are sometimes regarded as their own mode, but never fall into the other categories.
Transportation is used for moving of people, animals, and other goods from one place to another.
List of cargo types:
1. Break bulk cargo or General cargo
2. Bulk cargo (Bulk dry cargo)
3. Bulk liquid cargo
4. Container cargo
5. Neo-bulk cargo
6. Passenger cargo
7. Project cargo
8. Refrigerated cargo
9. Roll-on/roll-off cargo
Break Bulk:
Concerns cargo that is carried in drums, bags, pallets or boxes. Such ships are typically geared.
Neo Bulk:
Concerns cargo where each pre-packaged unit is accountable such as lumber (bundles), paper (rolls), steel and vehicles.
Containerized:
The growth of container shipping required the creation of a new general cargo category where the cargo is being carried in container load units.
Liquid bulk:
The majority of the liquid bulk being carried is petroleum LNG (Liquefied Natural Gas) represents an emerging segment.
Liquid bulk ships are commonly referred as tankers.
Dry Bulk:
Concerns a wide variety of materials such as coal, iron ore, grains bauxite and sand.
The term cargo is also used in case of goods in the cold-chain,
because the perishable inventory is always in transit towards a final end-use,
even when it is held in cold storage or other similar climate-controlled facility.
The term freight is commonly used to describe the movements of flows of goods being transported by any mode of transportation.
The means of transport, on the other hand, refers to the vehicles necessary for transport according to the chosen mode i.e. airplane, ship, truck and rail.
Each mode of transport has a fundamentally different technological solution, and some require a separate environment.
Each mode has its own infrastructure, vehicles, and operations.
Mode of transport:
Mode of transport is a term used to distinguish between different ways of transportation or transporting people or goods.
The different modes of transport are
1. Air,
2. Water,and
3. Land transport, which includes Rails or railways, road and off-road transport.
Other modes also exist, including pipelines, cable transport, and space transport.
Human-powered transport and animal-powered transport are sometimes regarded as their own mode, but never fall into the other categories.
Friday, December 13, 2019
Write a program in python to Find Reverse of a Number
Write a program in python to Find Reverse of a Number
# Python Program - Find Reverse of a Number
print("Enter 'x' for exit.");
num = input("Enter any number: ");
if num == 'x':
exit();
try:
number = int(num);
except ValueError:
print("Please, enter a number...");
else:
rev = 0;
while number > 0:
rev = (rev*10) + number%10;
number //= 10;
print("Reverse of entered number =",rev);
# Python Program - Find Reverse of a Number
print("Enter 'x' for exit.");
num = input("Enter any number: ");
if num == 'x':
exit();
try:
number = int(num);
except ValueError:
print("Please, enter a number...");
else:
rev = 0;
while number > 0:
rev = (rev*10) + number%10;
number //= 10;
print("Reverse of entered number =",rev);
Write a program in python to Calculate Circumference of Circle
Write a program in python to Calculate Circumference of Circle
# Python Program - Calculate Circumference of Circle
print("Enter 'x' for exit.");
rad = input("Enter radius of circle: ");
if rad == 'x':
exit();
else:
radius = float(rad);
circumference = 2*3.14*radius;
print("\n Circumference of Circle =",circumference);
Write a program in python to Calculate Perimeter of Square
Write a program in python to Calculate Perimeter of Square
# Python Program - Calculate Perimeter of Square
print("Enter 'x' for exit.");
side = input("Enter side length of square: ");
if side == 'x':
exit();
else:
slength = int(side);
perimeter = 4*slength;
print("\nPerimeter of Square =", perimeter);
# Python Program - Calculate Perimeter of Square
print("Enter 'x' for exit.");
side = input("Enter side length of square: ");
if side == 'x':
exit();
else:
slength = int(side);
perimeter = 4*slength;
print("\nPerimeter of Square =", perimeter);
Write a program in python to Calculate Area of Square
Write a program in python to Calculate Area of Square
Answer:
# Python Program - Calculate Area of Square
print("Enter 'x' for exit.");
side = input("Enter side length of Square: ");
if side == 'x':
exit();
else:
side_length = int(side);
area_square = side_length*side_length;
print("\nArea of Square =",area_square);
Answer:
# Python Program - Calculate Area of Square
print("Enter 'x' for exit.");
side = input("Enter side length of Square: ");
if side == 'x':
exit();
else:
side_length = int(side);
area_square = side_length*side_length;
print("\nArea of Square =",area_square);
Write a program in python to Calculate Area of Circle
Write a program in python to Calculate Area of Circle
# Python Program - Calculate Area of Circle
print("Enter 'x' for exit.");
rad = input("Enter radius of circle: ");
if rad == 'x':
exit();
else:
radius = float(rad);
area = 3.14 * radius * radius;
print("\nArea of Circle = %0.2f" %area);
# Python Program - Calculate Area of Circle
print("Enter 'x' for exit.");
rad = input("Enter radius of circle: ");
if rad == 'x':
exit();
else:
radius = float(rad);
area = 3.14 * radius * radius;
print("\nArea of Circle = %0.2f" %area);
Write a program in python to Calculate Area of Triangle
Write a program in python to Calculate Area of Triangle
# Python Program - Calculate Area of Triangle
print("Enter 'x' for exit.");
side1 = input("Enter length of first side: ");
if side1 == 'x':
exit();
else:
side2 = input("Enter length of second side: ");
side3 = input("Enter length of third side: ");
a = float(side1);
b = float(side2);
c = float(side3);
s = (a + b + c)/2;
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5;
print("\nArea of Triangle = %0.2f" %area);
# Python Program - Calculate Area of Triangle
print("Enter 'x' for exit.");
side1 = input("Enter length of first side: ");
if side1 == 'x':
exit();
else:
side2 = input("Enter length of second side: ");
side3 = input("Enter length of third side: ");
a = float(side1);
b = float(side2);
c = float(side3);
s = (a + b + c)/2;
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5;
print("\nArea of Triangle = %0.2f" %area);
Write a program in python to Calculate Area of Rectangle
Write a program in python to Calculate Area of Rectangle
# Python Program - Calculate Area of Rectangle
print("Enter 'x' for exit.");
leng = input("Enter length of Rectangle: ");
if leng == 'x':
exit();
else:
brea = input("Enter breadth of Rectangle: ");
length = int(leng);
breadth = int(brea);
area = length*breadth;
print("\nArea of Rectangle =",area);
# Python Program - Calculate Area of Rectangle
print("Enter 'x' for exit.");
leng = input("Enter length of Rectangle: ");
if leng == 'x':
exit();
else:
brea = input("Enter breadth of Rectangle: ");
length = int(leng);
breadth = int(brea);
area = length*breadth;
print("\nArea of Rectangle =",area);
Write a Python Program Code to Print Floyd's Triangle
Write a Python Program Code to Print Floyd's Triangle
Answer:
# Python Program - Print Floyd Triangle
print("Enter 'x' for exit.")
ran = input("Upto how many line ? ")
if ran == 'x':
exit();
else:
rang = int(ran)
k = 1
for i in range(1, rang+1):
for j in range(1, i+1):
print(k, end=" ")
k = k + 1
print()
Answer:
# Python Program - Print Floyd Triangle
print("Enter 'x' for exit.")
ran = input("Upto how many line ? ")
if ran == 'x':
exit();
else:
rang = int(ran)
k = 1
for i in range(1, rang+1):
for j in range(1, i+1):
print(k, end=" ")
k = k + 1
print()
Subscribe to:
Posts (Atom)
अच्छे विचार करे विचार
पहचान की नुमाईश, जरा कम करें... जहाँ भी "मैं" लिखा है, उसे "हम" करें... हमारी "इच्छाओं" से ज़्यादा "सुन...
-
Program 1:- Write a function in C++ that exchanges data (passing by references )using swap function to interchange the given tw...
-
Directions: In each Q1 to Q3 of the following questions, there are five letter groups or words in each question. Four of these letter g...
-
#include<stdio.h> #include<conio.h> void main() { int a[10],b[10],c[10]; int n,k,i,p,coeff; clrscr(); for(i=0;i<1...