Sunday, March 14, 2010

Selection statement in C



C support 2 selection statement


If    and  Switch


General form of  IF is


if ( expression ) statement;
else  statement.


Nested IF


if (i)
{
if (j) does something( );
if(k) doessomething( );
else doessomething( );
}
else doessomething( );




? this operator can replace the if-else statement into the general form


? is called ternary operator


General form is


Exp1 ? Exp2 : Exp3


Exp1 is evaluvated if it is true then print Exp2 else print Exp3


Example


X=10;
Y=X>9 ? 100 : 200;

Back slash character constan



c includes some back slash character constant.
so you may easily enter these special character as constant.
They are also reffered as escape sequence.

#include
int main(void)
{

printf("\n\t This is a test.");
return 0;
}

code            meaning

\b                Back space
\f                 form used
\n                new line
\r                 carriage return
\t                 horizantal tab
\"                Double quote
\'                 Single quote
\\                 Back slash
\v                vertical tab
\a                Alert
\?                Question mark
\N               octal constant
\xN             Hexadecimal constant

Friday, March 12, 2010

what is PHP?

PHP


What is PHP ?

It is an acronym for Hypertext Preprocessor.

It is widely used open source general scripting language.

It is especially suited for web development and can be embedded into HTML.











The origins of PHP:
          
  “  Wonderful things come from singular inspiration”


PHP began life as simple way to track visitors to Rasmus Ledorf’s resume.

It also could embed SQL queries in web pages.




What can PHP do ?
                   Anything. PHP is mainly focused on
 server side scripting, so you can do anything any
other CGI program can do, such as collect from data,
generate dynamic page content or send and receive
cookies. But PHP cannot do much more.

Thursday, March 4, 2010

we are always in the right situation.


“Some flowers grow best in the Sun while others do well in Shade.
Remember, we are put where we grow the best and accordingly we get people and situations to grow with”
 A lot of times we get this question :”Why I am this situation when others are in a better one”.The quote above explains a lot. We all have different lessons to learn to grow. A dishonest man need to learn what is honesty while a greedy man needs to learn how to be generous.
Sometimes I think the whole nature is so perfect. There is a perfect rhythm and balance in all the things in nature. Only a prefect one can design such a perfect system and how can that perfect one put us in a  wrong situation. At times things seem bad but when you look back you know there was a good reason why that happened. I feel when we accept what we have and where we are, the intense peace and power that we get enable us to overcome the toughest  situation in life.
May we all realize that life is fair and we are always in the right situation