ALGORITHM EVEN
BEGIN
FOR ( num = 0; num <= 20; num++ )
BEGIN
IF ( num MOD 2 == 0 ) THEN
DISPLAY (num)
END IF
END FOR
END EVEN
in C:
#include <stdio.h>
int main (void) { puts ("0 2 4 6 8 10 12 14 16 18 20"); return 0; }
#include<iostream.h>
#include<stdlib.h>
int main( )
{
int i=1;
for( i = 1; i<20; i++)
{
if( i%2 == 1)
{
cout << "\n" << i ;
}
}
system("PAUSE");
return 0;
}
The following loops through the numbers, 2 at a time:
for (i = 2; i <= 200; i+=2)
System.out.print(i + " ");
Here is another version; loop through all the numbers, and check whether each number is even:
for (i = 1; i <= 200; i++)
if (i % 2 == 0) // Checks remainder of division by 2
System.out.print(i + " ");
public class even_no {
public static void main( String args[])
{
int x=2;
for(x=2;x<=100;x+=2)
{
System.out.println(x);
}
}
}
#include <iostream>
int main()
{
for(int i = 100; i >= 1; i--)
{
if(i % 2 != 0)
printf("%d\n", i);
}
return 0;
}
int i;
for (i=2; 2<=20; i+=2) printf ("%d\n", i);
No if...else is required; what condition do you need? Just use a loop. For example, in Java: for (int i = 1; i
Here are two options in Java: // Option 1, increment by 2 at a time: for (int i = 2; i
Notepad++
#include<stdio.h> main() { int i=0,j=0,n; printf("Enter a number:"); scanf("%d",&n); printf("The first %d odd numbers are:-\n"); for(i=0;i<=n;i++) { if(j%2!=0) printf("%d\n"j); j=j+1; } }
Data is the information that a program will act upon. For example, your data might be all of your financial records for the past year, and the program would be some piece of tax software. The program will act upon your data so that the appropriate numbers are placed in the appropriate fields on your tax return.
If you had an array int numbers[10]; you would do it like this: CODE: int lowestnumber = numbers[0]; for(int i = 0; i < 10; i++){ if(numbers[i] < lowestnumber) lowestnumber = numbers[i]; } END CODE I think this should work, and in the end the variable lowestnumber will hold the lowest value in the ten. Hope this helps.
Use an enum if you are using a c style language. Or a map data structure. Assign each integer an English value and then match it to what the user inputs.
HTML is the program language that actually displays the content on a page and without it or an alternative, such as php, nothing would display on the page.
what is an application program that allows you to search for and display web pages?Examples would be, Internet Explorer, FireFox, Opera, Crome and many more.
71
#include<stdio.h> main() { int i=0,j=0,n; printf("Enter a number:"); scanf("%d",&n); printf("The first %d odd numbers are:-\n"); for(i=0;i<=n;i++) { if(j%2!=0) printf("%d\n"j); j=j+1; } }
No, if it is coded it would display only set of meaningless characters.
i think its 17
No. An irrational number is one that does not repeat or finish, and a calculator cannot display millions of digits like an irrational number would have.
Since there is an infinite set of prime numbers the answer would be infinity.
wat
There are an infinity of numbers between 12.0 and 29.0 so it would be impossible to list them.
Between them, not including them it is 36. If you include these two numbers, it would be 38.
You would need a program like DropBox. You would need to have a network connection between the two computers you want to use. Another program would be YouSendIt.
Any spreadsheet program would tell you... 28,920