Is programming very difficult? Will it take for me to expert a language? Maybe i shouldn't be programer!! Do these questions scare you when you start your programming journey...
If you wanna know how to write a program and you are the beginer then you are the right place......
1. Firstly, analyse the statement and try to findout what's the purpose of the program..
2.Once you analyse the statement ,then figureout what's the logic you have to use to make the program work.
3.After figuring out the logic start the program in the language that suits you like Java , C++, C etc ..
keep in mind that logic of every language is same the only difference is the functions and headerfiles or library. Some methods or decleration might be same or different those methods you have to learn.
4. Now , start with you header files and reach till the object of the class .
Note: if you are using Object Oriented Programming like java then you have make one or more objects that defines all your methods.
5. For example : Suppose you have to write a program that take two num and returns the sum ,then diectly you can figure out that we have to take two numbers as a inputs and add these inputs to get the output.
6. //writing a java program..
class ADD
{
public void main()
{
int a=5,b=19,sum;
sum=a+b;
System.out.println("Sum="+sum);
}
}
NOTE:i have not created any object because i am writing the logic inside the main method......
No comments:
Post a Comment