to print the sum of first ten numbers:-
void main()
{int i,sum;
sum=0;
while(i<=10)
sum=sum+i;
i=i+1;
}
printf("The sum is : %d",sum);
}
int sumNums(int n) {
int sum = 0;
while(n >= 1) {
sum += (n--);
}
return sum;
}
draw a flowchart to display the first tenth even number
create a program that iterates until it finds a perfect number, then store that perfect number into an array. Continue iterating until you find three more. Then, you have an array of four perfect numbers.
identification division. program-id. greatest. environment division. data division. working-storage section. 77 a pic 999. 77 b pic 999. 77 c pic 999. procedure division. greatest. display "ENTER THE THREE NUMBERS:". accept a. accept b. accept c. if a > b and a > c display a "is greatest" else if b > c display b "is greatest" else display c "is greatest". display " thank you". stop run.
seq 1 2 99
how to write a program that counts automorphic number from 1 to 999
the following program will display all numbers given in the array in ascending order #include<stdio.h> void main() { int i,h,p; int numbers[10]={5,8,3,2,6,7,9,4,1,10}; for(p=0;p<=8;p=p+1) { for(i=0;i<=8;i=i+1) { if(numbers[i]>numbers[i+1]) { a=numbers[i]; numbers[i]=numbers[i+1]; numbers[i+1]=a; } } } for(i=0;i<=9;i=i+1) { printf("%d ",numbers[i]); } }
Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.
When the cell is not wide enough to display the numbers that are in it. Widening the column will enable you to see the numbers properly.
Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.
Initialise an unsigned integer to zero. As each number is input, increment the running total accordingly. When all numbers are input, display the total.
draw a flowchart to display the first tenth even number
ten
Read 2 numbers. If first is larger than second, display second, else display first. That's for the smallest. For the largest reverse the two. For each of the other two, it's easier to just create a variable, call it largest. Initialize it to a very small number, say -1. As you read each number, compare it to largest. If the number is larger than largest, set largest equal to the number. When you finish each list of numbers, then print largest. Best answer Read 2 numbers. If first is larger than second, display second, else display first. That's for the smallest. For the largest reverse the two. For each of the other two, it's easier to just create a variable, call it largest. Initialize it to a very small number, say -1. As you read each number, compare it to largest. If the number is larger than largest, set largest equal to the number. When you finish each list of numbers, then print largest.
write a program to display your name age class schoolname e-mail 2hobby based on choice
A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.
Accept a number. Display all numbers from 0 up to it. Example: If input number is 5, output should be 0 1 2 3 4Accept two numbers. Display all numbers between them. Example: If input numbers are 10 and 15, output should be 11 12 13 14Accept a number. Display all even numbers less than that number. Example: If input number is 7, output should be 2 4 6Accept a number and display its multiplication table. Example: If input number is 3, output should be 3 X 1 = 3, 3 X 2 = 6..... [For/while loop needed]Accept a number and find the sum of all numbers from 0 till that number. If input number is 3, output should be 6 (0 + 1 + 2 + 3)Create two int variables a and b, each = 30000. Try to assign c = a +b. Display c. Answer is not 60000. Why?Good luck.
certificate of number