Tuesday, December 30, 2014

Programming is Fun (for those who dont like programming)

                                        

Today I am planning to start a blog to those who are students and wants to learn programming from scratch my approach will be for typical Indian minds because I know how our students can grasp programming. It is very easy and i hope you all will enjoy this.

Please share your views by commenting below the blogs and if you have doubts then Please mention them also I will try to solve them as soon as possible.


                     Here I am starting with C language developed by Denis Ritchie.

                             
First of all, we know that
                                what ever We do.. we do it for some"Output"


Example: like we are studying this blog to learn C.
                       So
Input is: Blog having C description.
Output is:Understanding C.

 So what is needed to convert input into output?

                                                       Answer is: Learning and studying.
                   Same thing is with programming we need to know 3 important questions?

what is input?

what output we want ?

what we have to do to get Output?

after these questions in your mind you need to have questions like---

how to take input from user?
how to show output to user?
What we have to do with input to convert it into output?
so our first problem is:

Q: I want to write a program to add two numbers?

so before writing a program we concentrate on the above question

like:(1) I need two numbers entered by user. 
         This will be called INPUT. 
(2)  I will show them sum of those INPUT numbers. 
This will be called OUTPUT.
(3)what I have to do covert input to output?

like
2+3=5
so input is 2 and 3 and 5 is output.

so to take input from user we have a "scanf"
and to give output we have a "Printf"

and if you are clear that what scanf will do and what printf will do then .. hurray you can say that you know programming.

Might be
you have seen program like below .
 Don't panic on seeing coding i will explain every bit.

#include<stdio.h>
void main()
{
int a,b,c;
scanf("%d",&a);
scanf("%d",&b);
c=a+b;
printf("%d",c);
}

here my main motto of writing these lines is to make you people to see scanf and printf statements only.


here scanf working as input statement for taking input and printf statement will give output.
If you still feel that you understanding nothing then have patience.  Everything will be alright

I will write much more to make a basic understanding of above written and once you will get idea you will see that programming is nothing... so wait I will explain it later. share as much as you can so that i will feel encouragement to help many people...


           to be continued........