What is computer programming?
Before getting into programming, we first check what is a computer?
So computer is a electronic device which accept some input, processed it and gives some output.
But here we want an output that we want, So in order to take a desired output from computer we will require a specific logic to be perform based on input, that is a computer program.
For an user any electronic device accepts some input and perform its work.
Lets take an example of a LED bulb, it can be used as light source, so the desired output from a bulb is light.
We can control it by adding a simple switch.
We can on and off switch to get the work done of a bulb, because it has only 2 states on and off.
Now lets take a bit complex electronic device,
A seven segment display.
It can be used to display a digit, So it has 10 states in total.
0 to 9.
To get desired output from this we will require multiple switches as an inputs.
To make a counter from it, we require certain circuit logic to perform we can call it a program for seven segment.
Similarly a computer is an electronic device which is very much complex then these devices and have many complex circuits and switches in computer's main part we call it CPU (Central Processing Unit), that we need to turn on and off to get required output.
To perform required task from this CPU, we give signals to it. these signals are the Instructions and combination of multiple instructions are nothing but computer program.
But we do not always write direct instructions, yes because it will be always difficult for everyone to write program directly for CPU instructions. Instead we write program in some high level programming languages like C, C++, Java, Python, Java script etc.
These program then converted into actual CPU instructions and we get the required output.
Thanks for reading, feel free to ask questions in comments.