Friday, October 7, 2011
Tuesday, October 4, 2011
And Far Away...
Wow, nice post,there are many person searching about that now they will find enough resources by your post.Thank you for sharing to us.Please one more post about that..Hcg weight loss
Wednesday, March 23, 2011
While statement
The simplest of all the looping structures in is the while statement.
The basic format of while statement is
while (test condition)
{
body of the loop
}
include<stdio.h>
void main( )
{
int sum = 0;
int n = 1;
while (n<=10)
{
sum = sum + n*n;
n = n+1;
}
print f ("sum = %d/n" ; sum);
}
Do-while
The general form of do while loop:
initialization:
do{
statement
increment
} while (condition);
include<stdio.h>
include<conio.h>
void main( )
{
int i = 5;
do { print f ("value of i = %d ", i);
i++
} while (i<5);
print f ("/n current value of i =%d" , i);
getch ( )
}
The basic format of while statement is
while (test condition)
{
body of the loop
}
include<stdio.h>
void main( )
{
int sum = 0;
int n = 1;
while (n<=10)
{
sum = sum + n*n;
n = n+1;
}
print f ("sum = %d/n" ; sum);
}
Do-while
The general form of do while loop:
initialization:
do{
statement
increment
} while (condition);
include<stdio.h>
include<conio.h>
void main( )
{
int i = 5;
do { print f ("value of i = %d ", i);
i++
} while (i<5);
print f ("/n current value of i =%d" , i);
getch ( )
}
Saturday, March 19, 2011
If and Else
Write a program that will read an integer number from the user.The program will examine whether it is an even number or odd number.
include <stdio.h>
include <conio.h>
void main ( )
{
clescr ( );
int number 1, number 2, R;
print f ("please enter two numbers");
scan f ("%d%d",& number 1,& number 2);
R = number 1%2;
if (R= = 0)
print f ("%d is an even number ", number 1);
if (R= = 1)
else
print f ("%d is an odd number", number 1);
print f ("n");
getch ( );
}
R = number 2%2;
if (R= = 0);
print f ("%d is an even number ". number 2);
else
print f (%d is an odd number ". number);
print f ("/n");
getch ( );
}
Program will input the total mark of a student.The program will then perform certain logical test and will print message depending on the test result.
include <stdio.h>
include <conio.h>
void main ( );
{
clrscr ( );
int number ;
print f ("Enter total mark of a student;");
scan f ("%d", & number);
if (number > = 330)
if (number > = 450)
if (number > = 600)
print f ("First division");
else
print f ("Second division");
else
print f ("Third division");
getch ( );
}
include <stdio.h>
include <conio.h>
void main ( )
{
clescr ( );
int number 1, number 2, R;
print f ("please enter two numbers");
scan f ("%d%d",& number 1,& number 2);
R = number 1%2;
if (R= = 0)
print f ("%d is an even number ", number 1);
if (R= = 1)
else
print f ("%d is an odd number", number 1);
print f ("n");
getch ( );
}
R = number 2%2;
if (R= = 0);
print f ("%d is an even number ". number 2);
else
print f (%d is an odd number ". number);
print f ("/n");
getch ( );
}
Program will input the total mark of a student.The program will then perform certain logical test and will print message depending on the test result.
include <stdio.h>
include <conio.h>
void main ( );
{
clrscr ( );
int number ;
print f ("Enter total mark of a student;");
scan f ("%d", & number);
if (number > = 330)
if (number > = 450)
if (number > = 600)
print f ("First division");
else
print f ("Second division");
else
print f ("Third division");
getch ( );
}
Assembler and Complier
The assembler of a computer system is a system software,supplied by the computer manufacturer which translates an assembly language program in to an equivalent machine language program of the computer.
A high level language program must be converted in to its equivalent machine language program before it can be executed on the computer.This translation is done with the help of a translation program,which is known as a compiler.
include <studio.h>
main ( )
{
int number;
print f ("Enter an integer number/n");
scan f ("d%", & number);
if (number <100);
print f ("your number is smaller than 100/n/n");
else
print f ("your number contains more than two light/n");
}
include <studio.h>
define PI 3.1416
main ( )
{
intr;
float area;
print f ("Enter the radius and hight of circle = ");
scan f ("%d", & r );
area = PI * r * r ;
print f ("Area of cylinder = % .2 f ",area);
}
A high level language program must be converted in to its equivalent machine language program before it can be executed on the computer.This translation is done with the help of a translation program,which is known as a compiler.
include <studio.h>
main ( )
{
int number;
print f ("Enter an integer number/n");
scan f ("d%", & number);
if (number <100);
print f ("your number is smaller than 100/n/n");
else
print f ("your number contains more than two light/n");
}
include <studio.h>
define PI 3.1416
main ( )
{
intr;
float area;
print f ("Enter the radius and hight of circle = ");
scan f ("%d", & r );
area = PI * r * r ;
print f ("Area of cylinder = % .2 f ",area);
}
Arithmatic instruction
int a, b, sum;
Float average
a = 10;
b = 25;
c = a;
Sum = a+b+c;
= 45;
Average = 45/3;
= 15.00
Input Instruction:
Scan f ( ) function is used to input integer.
Output Instruction:
Print f ( ) function is used to print.
Variable declaration Instruction:
int a;
float b;
Control Instruction:
> Sequential control instruction.
> Selection control instruction.
> Looping control instruction.
include <stdio.h>
main ( )
{
int number
Print f ("Enter an integer number/n");
Scan f ("%d",& number);
if (number<100)
print f ("your number is smaller than 100/n/n");
else
Print f ("your number contains more than two digits/n");
return 0;
}
Float average
a = 10;
b = 25;
c = a;
Sum = a+b+c;
= 45;
Average = 45/3;
= 15.00
Input Instruction:
Scan f ( ) function is used to input integer.
Output Instruction:
Print f ( ) function is used to print.
Variable declaration Instruction:
int a;
float b;
Control Instruction:
> Sequential control instruction.
> Selection control instruction.
> Looping control instruction.
include <stdio.h>
main ( )
{
int number
Print f ("Enter an integer number/n");
Scan f ("%d",& number);
if (number<100)
print f ("your number is smaller than 100/n/n");
else
Print f ("your number contains more than two digits/n");
return 0;
}
Thursday, March 17, 2011
Introduction of Programming
An algorithm is a step by step program solving procedure.It can be carried out by a computer.An algorithm is a set of rules or steps to solve a mathematical problem or computer program.Algorithm describe how people realise a problem.
Find a right may to solve it,analysis the available resources (data).Make an optimal solution and finally output the result.
A good algorithm should have the following properties :
1. It should be simple on possible.
2. Steps must be unambiguous.So that they are understood by the complex property.
3. It should be understood by other.
4. It must be effective to solve the required problem.
5. It must be able to find an optimal salvation.
6. It should have the capability to handle some unexpected situation during the problem solving.
ALGORITHM
Step-1: Total first division and total mark sheet checked to zero.
Step-2: Take the mark sheet to the next student.
Step-3: Check the division column of the mark sheet to see it is first.It no go step-5.
Step-4: Add 1 total first division.
Step-5: Add 1 total mark sheet checked.
Step-6: Is total mark sheet checked = 50?
It no go to step?
Step-7: Print total first division.
Step-8: Stop.
Pseudo code is an alternative of flow chart.It allows the programmer to describe the solution of a problem which may look like plain English.The reason for pseudo code in to represent the solution to any body without programming difficulties.
Input Number
WHILE Number <1 DO
Input Number
End WHILE
If the number %2 = 0 THEN
Print Even number
ELSE
Print Odd number
END IF
STOP.
include <stdio.h>
main ( )
{
Print f ("Hello world !");
Print f ("This is our first C program !");
Print f ("This is really a enjoyable moment !");
Return 0 ;
}
Include <stdio.h>
void main ( )
{
int a,b,sum;
a = 4 ;
b = 6 ;
Sum = a+b ;
Print f ("Result is % d", sum);
}
Find a right may to solve it,analysis the available resources (data).Make an optimal solution and finally output the result.
A good algorithm should have the following properties :
1. It should be simple on possible.
2. Steps must be unambiguous.So that they are understood by the complex property.
3. It should be understood by other.
4. It must be effective to solve the required problem.
5. It must be able to find an optimal salvation.
6. It should have the capability to handle some unexpected situation during the problem solving.
ALGORITHM
Step-1: Total first division and total mark sheet checked to zero.
Step-2: Take the mark sheet to the next student.
Step-3: Check the division column of the mark sheet to see it is first.It no go step-5.
Step-4: Add 1 total first division.
Step-5: Add 1 total mark sheet checked.
Step-6: Is total mark sheet checked = 50?
It no go to step?
Step-7: Print total first division.
Step-8: Stop.
Pseudo code is an alternative of flow chart.It allows the programmer to describe the solution of a problem which may look like plain English.The reason for pseudo code in to represent the solution to any body without programming difficulties.
Input Number
WHILE Number <1 DO
Input Number
End WHILE
If the number %2 = 0 THEN
Print Even number
ELSE
Print Odd number
END IF
STOP.
include <stdio.h>
main ( )
{
Print f ("Hello world !");
Print f ("This is our first C program !");
Print f ("This is really a enjoyable moment !");
Return 0 ;
}
Include <stdio.h>
void main ( )
{
int a,b,sum;
a = 4 ;
b = 6 ;
Sum = a+b ;
Print f ("Result is % d", sum);
}
Subscribe to:
Posts (Atom)