Monday, December 12, 2011
Your First Program
Don't know anything about programming don't worry as you read this blog u will learn to program within few weeks and most importantly you will enjoy it.So , you have decided to learn programming so first you need to know what is a program.A program is an implementation to an algorithm,so whats an algorithm ,it is a set of steps written to perform a particular task.like, an algorithm to add two numbers.
Step 1:Take the first number.
Step 2:Take the second number.
Step 3: add them .
Step 4:Display the result.
So, to implement the above algorithm in a program you need to choose a programming language and since C is a basic programming language and yet very powerful we choose C , to start the programming.
You just need to know a few things to use C,they are:
1.Variables : they store data.
2.Datatypes:they represents the type of data stored.
3.Operators: they are used for manipulations.
Lets start with implementing the algorithm.
int a=10;
int b=20;
int c=a+b;
printf("%d",c);
Sunday, November 20, 2011
for each
Guess the output:
public class ForEachDemo {
public static void main(String args[]){
int a[]={1,8,1,1,1,1,1,1,1,1};
for(int i:a)//for each is for arrays display
System.out.println(a[i]);
}
}
Output:
8
1
8
8
8
8
8
8
8
8
Guess the output: public class ForEachDemo { public static void main(String args[]){ int a[]={1,8,1,1,1,1,1,1,1,1}; for(int i:a)//for each is for arrays display System.out.println(i); } }
output:
1 8 1 1 1 1 1 1 1 1
Guess the output: public class ForEachDemo { public static void main(String args[]){ int a[]={1,8,1,1,1,1,1,1,1,1}; for(int i:a)//for each is for arrays display System.out.println(i); } }
output:
1 8 1 1 1 1 1 1 1 1
Sunday, November 13, 2011
processing streams
perform some sort of operation such as buffering or encoding as they reaad and write.
Data sink stream
they are used to read from or write to specialized data sink such as files pipes strings.
byte stream
Input and output stream are byte stream.eg:images ,sounds.
2 types:
1.ObjectInputStream
2.ObjectOutputStram
2 types:
1.ObjectInputStream
2.ObjectOutputStram
Subscribe to:
Posts (Atom)
-
Hi Guys , In this blog I will share information related to error : can't bind to 'formcontrol' since it isn't a known pr...
-
Hi Guys , This blog is about the error " Target container is not a DOM element. " The full error in the console log is ...
-
Error Blog This blog is about the error Error: Objects are not valid as a React child Problem Statement error on start of...