Reverse String in C programming

Add caption Reverse String in C  :- The Purpose of Reverse String in C is …
GETTING STARTED WITH PYTHON PROGRAMMING. Python is a high-level, interpret…

Getting started With Learn To Code

Getting started With Learn To Code The hardest part of learning something …
Why Should you learn how to PROGRam. This first point is by far the most imp…

PROGRAMMING IN C- A function which outputs all the prime numbers between 2 and a given positive integer n:



This program will allow users to find the the prime numbers between 2 and a given positive integer 


Complied On : Code::Blocks 17.0

Save :- .c file (C Program)

Created By :- Lukas Yooma 
Find the code below
                                                                                                                                                                   

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i,j, n=0,prime;

    printf("PLEASE ENTER THE NUMBER TO FIND ITS PRIME NUMBERS :\t");
    scanf("%d", &prime);
    for(i = 2; i <=prime; i++)
    {
        for (j=1; j<= i; j++)
        {
            if (i%j == 0)
            {
                n++;
            }
        }
        if (n == 2)
    printf("%d\n", i);
    n=0;
    }
    getchar();

    main();
}
                                                                                                                                                                
Thanks for reading, leave a comment for any queries
                                                                                                       

Programming in C - A program which inputs a person’s height (in centimeters) and weight (in kilograms) and outputs one of the messages: underweight, normal, or overweight, using the criteria:






A program which inputs a person’s height (in centimeters) and weight (in kilograms) and outputs one of the messages: underweight, normal, or overweight, using the criteria:
              Underweight:    weight < height/2.5
              Normal:             height/2.5 <= weight <= height/2.3

              Overweight:      height/2.3 < weight


Complied On : Code::Blocks 17.0

Save :- .c file (C Program)

Created By :- Lukas Yooma 
Below is the code 
                                                                                                                                            
#include <stdio.h>
#include <stdlib.h>

int main()
{
    float height, weight;

    printf("\nENTER YOUR HEIGHT IN CENTMETERS \n");
    scanf("%lf",&height);
    printf("\nENTER YOUR WEIGHT IN KILOGRAMMES \n");
    scanf("%lf", &weight);

    if(weight < height/2.5)
    printf("YOU ARE UNDERWEIGHT \n");
    else


    if(height/2.3 < weight)
    printf("YOU ARE OVERWEIGHT \n");
    else


    if(height/2.5 <= weight <= height/2.3)
    printf("YOU ARE NORMAL\n");


    main(0);
}
                                                                                                                                                                   
Thanks for reading leave a comment for any queries

Reverse String in C programming


Add caption
Reverse String in C  :-
The Purpose of Reverse String in C is to reverse sentences from the end to 
the beginning 



Complied On : Code::Blocks 17.05

Save :- .c file (C Program)

Created By :- Luka Yooma 


Below Is the code for the Reverse String



/**
 * C program to reverse order of words in a string
 */
#include <stdio.h>
#include <string.h>
#define MAX_SIZE 100 // Maximum string size

int main()
{
    char str[100], reverse[100];
    int len, i, index, wordStart, wordEnd;

    printf("Enter any sentence:\n\t ");
    gets(str);

    len   = strlen(str);
    index = 0;

    // Start checking of words from the end of string
    wordStart = len - 1;
    wordEnd   = len - 1;

    while(wordStart > 0)
    {



        // If a word is found
        if(str[wordStart] == ' ')
        {
            // Add the word to the reverse string
            i = wordStart + 1;
            while(i <= wordEnd)
            {
                reverse[index] = str[i];

                i++;
                index++;
            }
            reverse[index++] = ' ';

            wordEnd = wordStart - 1;
        }

        wordStart--;
    }

    // Finally add the last word
    for(i=0; i<=wordEnd; i++)
    {
        reverse[index] = str[i];
        index++;
    }

    // Add NULL character at the end of reverse string
    reverse[index] = '\0';

    printf("Original sentence \n%s\n\n", str);
    printf("Reversed Sentence \n%s", reverse);

    return 0;

}




Thanks to all my Readers Leave a comment for any queries.......

GETTING STARTED WITH PYTHON PROGRAMMING.

Image result for Python
Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages.
  • Python is Interpreted − Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar to PERL and PHP.
  • Python is Interactive − You can actually sit at a Python prompt and interact with the interpreter directly to write your programs.
  • Python is Object-Oriented − Python supports Object-Oriented style or technique of programming that encapsulates code within objects.
  • Python is a Beginner's Language − Python is a great language for the beginner-level programmers and supports the development of a wide range of applications from simple text processing to WWW browsers to games.

History of Python

Python was developed by Guido van Rossum in the late eighties and early nineties at the National Research Institute for Mathematics and Computer Science in the Netherlands.
Python is derived from many other languages, including ABC, Modula-3, C, C++, Algol-68, SmallTalk, and Unix shell and other scripting languages.
Python is copyrighted. Like Perl, Python source code is now available under the GNU General Public License (GPL).
Python is now maintained by a core development team at the institute, although Guido van Rossum still holds a vital role in directing its progress.

Python Features

Python's features include −
  • Easy-to-learn − Python has few keywords, simple structure, and a clearly defined syntax. This allows the student to pick up the language quickly.
  • Easy-to-read − Python code is more clearly defined and visible to the eyes.
  • Easy-to-maintain − Python's source code is fairly easy-to-maintain.
  • A broad standard library − Python's bulk of the library is very portable and cross-platform compatible on UNIX, Windows, and Macintosh.
  • Interactive Mode − Python has support for an interactive mode which allows interactive testing and debugging of snippets of code.
  • Portable − Python can run on a wide variety of hardware platforms and has the same interface on all platforms.
  • Extendable − You can add low-level modules to the Python interpreter. These modules enable programmers to add to or customize their tools to be more efficient.
  • Databases − Python provides interfaces to all major commercial databases.
  • GUI Programming − Python supports GUI applications that can be created and ported to many system calls, libraries and windows systems, such as Windows MFC, Macintosh, and the X Window system of Unix.
  • Scalable − Python provides a better structure and support for large programs than shell scripting.
Apart from the above-mentioned features, Python has a big list of good features, few are listed below −
  • It supports functional and structured programming methods as well as OOP.
  • It can be used as a scripting language or can be compiled to byte-code for building large applications.
  • It provides very high-level dynamic data types and supports dynamic type checking.
  • IT supports automatic garbage collection.
  • It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.

Getting started With Learn To Code

Image result for learn programming

Getting started With Learn To Code

The hardest part of learning something new is to actually getting started. The first thing you have to do is to decide which particular language you want to learn. There's a plethora of different languages out there like JavaJavaScriptRubyPythonC++ or Objective-C.
Choosing the right language is crucial when it comes to implementing concrete projects. For example Android apps are written in Java while iOS use Objective-C (or Swift). Web applications are written in JavaScript (at least parts of the frontend) while hardware-targeted software often use languages like C or C++.
You should read the corresponding wikipedia articles for those languages which sound interesting to you to get a general view and then decide which language you want to start with. But don't stress you too much, learning the second language is much simpler than the first - so your decision is not written in stone.
Often the language decision is taken by someone else for you, e.g. if you're going to visit a programming course at school, university or even online. This is how I started to learn programming in Java at university back in 2001. We first made a quick excursion to Scheme (a Lisp-like language) before we deep-dived into Java.
The first things you probably learn in a programming 101 course is the basic syntax and semantic of the language. If you're not able to visit a programming course in real life don't bury your head in the sand. There's plenty of ways to learn the basics of programming. Sites like Code School or Khan Acadamey offer online programming courses. Some universities offer online video lectures (see Coursera). And of cause you can just buy a programming book for beginners. Go to Amazon and search for e.g. java beginners guide (make sure to read the reviews).
Don't learn solely with blog tutorials because more than often they are superficial and unsuitable for beginners. Tutorials are great for more advanced programmers but not so great for beginners.

Avoid StackOverflow

Meanwhile you're able to write some basic code. Depending on the language you eventually know how to compile and run the code on your local machine. You also have some basic understanding how to structure the code in your language of choice. This is a good moment to start your first example project in order to gain more practice. Depending on how you learn your lector/ mentor/ book author will usually provide enough exercises for you to practice what you've learned.
Here's my most important advice to you: Avoid using StackOverflow.com to find the answers to your questions! Seriously, don't do it! StackOverflow is a great source of knowledge but it's counter-productive while in the process of learning the basics of programming. If you use StackOverflow you'll find yourself copy/pasting code snippets into your code without thinking enough about the fundamental concepts and how the code really works.
Instead you should focus solely on the documentation provided by your course or the book you read. You should also use the official language documentation. Using those documentations for solving problems teaches you crucial researching technics. Often you find yourself reading about stuff which not only solves your current problem but widens your knowledge in other parts of programming.
You have to research and find out things by yourself in order to become a great programmer. This way of learning is lengthy and tedious but it definitely pays off at the end.

Failure is good

After successfully finishing your first small programming projects you should feel quite comfortable with the basic edit - compile -run cycle of programming. You're doing fewer syntax mistakes resulting in fewer syntax errors while compiling the code. But you eventually still see semantical errors quite often. But don't be to afraid - failure is good. Every failure you encounter and every problem you solve let your knowledge grow. Even the most advanced programmers make mistakes from time to time.

Why Should you learn how to PROGRam.

This first point is by far the most important thing you need to consider.
Why are you interested in learning coding?
Try to be aware of and analytical about the reasons why you wish to learn programming. I don’t mean that you need to spend days or weeks figuring this out. But take some time and make sure you know what’s motivating you.
Once you figure out what your “mission” is, you will know what steps are necessary to achieve your goal.
Remember that learning programming is a process that will tie you up for a long time. And things will not always go the way you plan, trust me.
Hence, you need to be able to find your motivation over and over again. You will need at least several months or even years to reach your goals.
Nevertheless, the journey towards your goal will be amazing, I promise.
Let’s look at two different scenarios here. These two are the top reasons I’ve heard why people want to start learning coding.

REASON #1: I’M IN IT FOR THE MONEY

These days, becoming a developer can give a nice boost to your paycheck. Right now, skilled programmers are some of the most sought-after employees worldwide. And also some of the highest-paid ones!
Thus, using all the amazing resources out there to teach yourself how to code could really change your life. As an added bonus, working as a programmer or web developer could give you more freedom in life when it comes to working remotely, for instance.
And the best part is: it’s easier than ever to learn digital skills online nowadays, so your timing couldn’t be better!

REASON #2: I THINK CODING IS COOL – I’M GENUINELY INTERESTED

If this is the case, then congratulations! You will most likely keep going even when times get rough and achieve your goals in the long run.
Perhaps you’re trying to learn how to automate stuff at work. Believe me, there’s a ton of things you can do to speed up your work with Excel, for instance.
Or maybe you’re using a simple mobile application and you’re not quite happy with its features. Learning how to program your own mobile app isn’t as difficult as you might think!
What sets this reason apart from the others is something called innate motivation. It’s the drive that keeps us going without much persuasion, rewards, or incentives. With innate motivation, we simply enjoy what we’re doing and we’re curious to see what’s headed our way next.
So whatever your reason is, just be aware of it. Having a clear idea of what is driving you to learn coding will help you stick to your learning routine. If you’re not quite sure about your long-term goals, it’s really easy to slip out of your practising schedule.
What matters the most is that you learn coding in a way that keeps you motivated. You will find the right way to achieve your goal once you know why you want to reach it in the first place.
How to start learning coding? Figure out why you want to learn programming and what you wish to create with coding

2: KNOW WHAT YOU WANT TO CREATE WITH CODING

This step will mainly determine the skills you need to learn in order to achieve your goals. Therefore, give it some thought before you start choosing your first programming language to learn.
With seemingly endless possibilities, coding can be used to the most diverse projects. You can start by thinking about the following questions:
  • Are you interested in creating websites?
  • Or would you rather build mobile applications?
  • How about some data analysis and visualization?
  • Or developing games or software?
Whatever it is that you wish to create, just be mindful about it. Of course, you could simply start learning a programming language for the sheer fun of learning it. However, your approach to learning would be completely different.
When you already know what sorts of problems you wish to solve with programming, learning it will definitely be a lot easier. When you’re learning about a specific topic, you can already have an idea about what you’re going to need that skill for in the future. Therefore, you will be more focused and pay more attention to what you’re learning.

3: CHOOSE THE RIGHT PROGRAMMING LANGUAGE

Once you have a clear goal, you come to the next question: what do you need to learn to be able to reach it?
So knowing what you wish to create is a problem you need to solve. And a programming language offers you the tools to solve that problem.
If you’re interested in web development, for example, you would learn a selection of the following languages:
  • HTML
  • CSS
  • JavaScript
  • Python
  • Ruby
  • PHP
The first three languages (HTML, CSS, JavaScript) are used for front-end development, meaning that they determine the look and feel of a website, for instance.
The latter three (Python, Ruby, PHP) are used in backend development. These languages are responsible for the logic and the different functionalities.

How to start learning coding? Choose the right programming language for your projects

4: START SMALL, TRACK YOUR LEARNING

When you start learning coding, remember to be kind to yourself and set realistic targetsfor your projects. I know how it feels when you’re impatient about creating all sorts of cool stuff, but try to keep it cool.
As a beginner, you don’t need to aim for the stars. Just like a freshly-graduated engineer doesn’t know how to build the world’s tallest building, you don’t need to know how to create the next Google.
You don’t have to be the best coder in the world.
Therefore, try to come up with little motivations for yourself. Start with simple tasks, like writing a small program that only does one thing.
Then, while you’re writing one program, you will get an idea for the next one. This cycle is a learning process that is fueled by your curiosity alone.
Remember that innate motivation I was talking about above? That’s exactly what’s happening here, too. You simply keep going because you enjoy solving little problems with coding.
With each problem that you solve, you are growing your set of skills and tools in programming. By reaching small targets one by one, things will start to come together. Then, slowly you will develop a skillset that will allow you to tackle bigger projects and solve more complex problems with coding.

5: UNDERSTAND COMPUTER SCIENCE BASICS

How to start learning coding?
By learning Computer Science basics first!
When you learn how to code, you’re telling computers what to do for you. To get a better idea of what computers are capable of, I’d recommend learning the basics of Computer Science right away.
Understanding how computers work will make learning programming much easier for you. You can think of trying to drive a car but not knowing what will happen when you turn the steering wheel. That’s what it feels like to code your own programs and run them on a device you don’t understand.
The bottom line is that you will simply reach your goals faster when you’re familiar with the fundamentals of Computer Science.
To help you out, here are a couple of online courses I can recommend for learning the basics of Computer Science if you’re an absolute beginner:
  • Computer Science 101 – this is a beginner-level course on Udemy that will teach you everything you need to know about Computer Science in order to see quicker results while learning how to code.
  • Computer Basics – this course at Team Treehouse is excellent for getting to know what Computer Science is all about and how computers actually work under the hood. If you’re not familiar with Team Treehouse, try their FREE 7-day trial!
  • Intro to Computer Science – learn the basics of Computer Science with this really well-structured and thorough course at Udacity. Throughout the course, you will code your very own simple search engine. As an added bonus, you will learn the basics of Python at the same time!
  • Computer Science E-50 – this beginner-level course is taught at Harvard College. Needless to say, the professor does an amazing job with the course – and it’s free!
Simply browse through the courses and see which one seems interesting to you. They’re all absolutely great, so pick whichever you like and you’ll learn all you need to know for now!
How to learn coding? Learn Computer Science basics

6: START AN ONLINE CODING COURSE

Ok, now you got a clear goal in your mind, you’ve chosen a programming language to learn, and you know a bit about how computers work.
Next, it’s time to actually start learning coding, finally!
Luckily, you will not have difficulties in finding enough resources online to get you started. Quite the opposite: the Internet is so packed with coding tutorials, guides, and courses that it’s hard to find the best ones out there as a beginner.
My only suggestion is that if you’re interested in learning web development, choose one course that will cover several different programming languages and other tools.
The trick here is to find a course that actually does a good job at teaching you multiple languages. Many courses out there simply give you a brief introduction to a bunch or languages but you end up with knowing none of them well enough to create something.
Since I’m a nice guy, I wouldn’t like that to happen to you. Here’s my favourite web developer course for beginners that I keep recommending over and over again:
  • The Complete Web Developer Course 2.0 at Udemy is an incredible all-in-one web development course that pretty much changed my life. It will not only introduce you to a wide array of different web dev languages and tools, but you will also build real projects throughout the course using each of the tools you learn!
You will basically learn all the tools you need to build all sorts of cool web projects just after this one course. Also, there are no prerequisites for starting these courses. If you know how to use a computer and a web browser, you’re good to go!
For other programming languages and tools, check out my guide for recommended coding courses for beginners. (Note: the guide is still under construction at the moment. If the programming language of your choice isn’t listed yet, please sign up for my newsletter and you’ll be the first to know when new content is released. Sorry for the inconvenience!) 

CONCLUSION: HOW TO START LEARNING CODING

Ok this was a long post, but I hope I managed to give you some helpful pointers on how to start learning coding as a total beginner.
The main point is: you’re not going to learn how to code by sitting down and saying that you want to learn programming.
Instead, your mindset should be more like this: you want to create something or solve a problem, and learning a programming language will be your tool for that.
Thus, coding itself is a journey, not a destination.
Just like a cook doesn’t learn how to prepare a dish simply for the fun of it, but instead in order to cook delicious meals for us hungry customers and offer us a great dining experience, for instance. Similarly, a taxi driver doesn’t learn driving just to cruise around town all day. Instead, they want to offer other people a service for getting from one place to another.
So try to be more aware of why you’re interested in learning programming. Simple as that. Once that’s done, you will find the right resources for learning and you will be well on your way towards becoming a developer.