Monday, March 7, 2016
Char Data Type
the char is used to storing simple character
Unsigned: It consist only positive value i.e 0 to 255.
-1 to -128
Signed: It consist both negative and positive values but in different formats like
- 0 to +127
And this all explanation is about 8 bit number system
Char has 1 byte only
int main()
{
char a ;
etc
Char has 1 byte only
int main()
{
char a ;
etc
Working of a floating point data type
Working of a floating point data type
Look and understand the program and output shown below simple understand what will
happen there #include
#include
int main(){
float far = 10;
printf("%1.0f\n", far );
printf("%2.0f\n", far);
printf("%3.0f\n", far);
printf("%4.0f\n", far);
printf("%5.0f\n\n", far);
printf("%1.1f\n", far );
printf("%1.2f\n", far);
printf("%1.3f\n", far);
printf("%1.4f\n", far);
printf("%1.5f\n", far);
getch();
return 0;
}
Working Of while loop
The while loop operates as follows , the condition is tested ,if the it is true .
That is the condition is true that means
for example
10 == 10 . or 10<20 .="" etc="" p="">If it is true the statement in the while loop will be work or execute
while(i < j )
{
stament for exection
}
Example
while(far <= upper )
20>
That is the condition is true that means
for example
10 == 10 . or 10<20 .="" etc="" p="">If it is true the statement in the while loop will be work or execute
while(i < j )
{
stament for exection
}
Example
while(far <= upper )
20>
{
celsius = 5 * (far - 32)/9;
printf("%d\t%d\n", far ,celsius);
far += step;
}
it will execute till until the condition will get false .
that is the far not equal to upper
NB :
The body of the while loop may be single or more line .
If there is a single line there is no need to add a the curly {} bracket
Eg :
while(i < j)
i = 2 * i ; // it will repeat until the condition fall
Introduction to c programming
Introduction to c programming
First Program
Hello World Program
We need to compiler and an IDE I am using Dev C++ IDE very good and simple one
It is a free and Open Source IDE .And small in size download it from Here Click Here
first Program
To print out the following words hello World
Subscribe to:
Posts (Atom)
