Skip to main content

Posts

Showing posts from November, 2018

C++ Program for Fibonacci series

Fibonacci Series   Such a series in which the sum of two preceding numbers is the next number i.e 1 1 2 3 5 8 13 21..... Following is the logic for Fibonacci series..... #include<iostream> using namespace std; void main() { int n, t1 = 0, t2 = 1, nextTerm = 0; cout << "Enter the number of terms: \n"; cin >> n; cout << "Fibonacci Series: \n"; for (int i = 1; i <= n; ++i) { if (i == 1) { cout << t1 << " "; continue; } if (i == 2) { cout << t2 << " "; continue; } nextTerm = t1 + t2; t1 = t2; t2 = nextTerm; cout << nextTerm << " "; } system("pause"); }

C++ Program for solving 2nd equatiion of motion (Kinematics)

As we know the 2nd equation of motion   #include<iostream> #include<cmath> using namespace std; void main() { double vi, vf, a, s; int eq; cout << "Press 1 to solve for acceleration, 2 for distance, 3 for initial velocity and 4 for final velocity \n"; cin >> eq; if (eq == 1) { cout << "Enter vf, vi and s \n"; cin >> vf >> vi >> s; a = (pow(vf, 2) - pow(vi, 2)) / (2 * s); cout << "Acceleration is " << a << endl; } else if (eq == 2) { cout << "Enter vf, vi and a \n"; cin >> vf >> vi >> a; s = (pow(vf, 2) - pow(vi, 2)) / (2 * a); cout << "Distance is " << s << endl; } else if (eq == 3) { cout << "Enter vf, s and a \n"; cin >> vf >> s >> a; vi = sqrt(pow(vf, 2) - 2 * a*s); cout << "Initial velocity is " <<

Mushkpuri Diaries

        What else can be better than having fun with friends? A long awaited morning came. We were done with the OHTs, it was exhausting. Who likes exams?               A good turned evil friend of mine, kicked me out of the bed when it was 5 on the clock and I was like WTF. We reached the bus stop at 6. OK, forget about the time, we were in the Bus and we even had breakfast in the Bus. We were about to leave the boundaries of College of Electrical and Mechanical Engineering, NUST (CEME, NUST).             There were 5 Buses, we were in a great number and it was our first trip from CEME, NUST to Mushkpuri top.  4 seniors came in our Bus, afterwards. The term Senior, is often terrifying to some, but we had a lot of fun with them.         When the journey started, our beloved Class Representative (CR) started making crazy faces and moves to entertain us, but we are grown-ups man, we wanted more. Songs started playing and we were dancing wildly. A boy at the back even broke the s

How to develop entrepreneurial skills?

        Its 21st century and nobody likes to work under someone, underpaid and unfulfilled. Rather, everyone likes others to work for them. But becoming an entrepreneur is not a piece of cake. You need some skills to excel in this particular field. Giving an idea and making a business modal comes afterward.         So, what skills you need to be an entrepreneur? Let's see... Creativity             Creativity is the root of entrepreneurship. Creativity is something, which comes through your smart-work rather than hard work. The people who procrastinate, about everything tends to be more creative because they cut short everything, but it's sometimes dangerous as well. You need creativity to excel. Being a book-worm cannot let you lead a perfect life and job or whatsoever. Delay gratification         Keeping a small budget enables you to manage your finances in an effective way. You know, what you are going through and what do you need. If you are out of th