#include
main(){
int i = 0;
int counter = 1;
while(i <= 100){
i = counter*counter;
counter++;
printf("The value of i is:%d\n", i);
}
exit(0);
}
END CODE
I think this should work and display the results in the terminal. I haven't tried it though, so it might not work.
Answer:#includeint main (void) { puts ("1 4 9 16..100"); retun 0; }
seq 1 2 99
write a program to print the series 1/12+1/22+.........+1/n2 ?
You can use the following C program to display "1" if a user enters any non-zero number, and "0" if the entered number is zero: #include <stdio.h> int main() { int num; printf("Enter a number: "); scanf("%d", &num); if (num != 0) { printf("1\n"); } else { printf("0\n"); } return 0; } This program reads an integer from the user and checks if it is non-zero or zero, then prints the corresponding output.
PRINT 2,3,5,7,11,13,17,19,23,29,31,37
printf("1 3 5 7 9\n");
seq 1 2 99
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.
we can find the product=230 X70 =16100 cm sq. 1 sq.m =10000 sq.cm. 16100 sq.cm=1.61 m² .
Simply use a for loop (i) that runs from 2 to N-1. Checking if N % i 0 then its a prime number.
write a program to print the series 1/12+1/22+.........+1/n2 ?
You can use the following C program to display "1" if a user enters any non-zero number, and "0" if the entered number is zero: #include <stdio.h> int main() { int num; printf("Enter a number: "); scanf("%d", &num); if (num != 0) { printf("1\n"); } else { printf("0\n"); } return 0; } This program reads an integer from the user and checks if it is non-zero or zero, then prints the corresponding output.
PRINT 2,3,5,7,11,13,17,19,23,29,31,37
sum=0 i=1 echo "Enter any number " read num while [ $i -le 10 ] do sum=`expr $num \* $i` i=`expr $i + 1` echo "Table of a number is " $sum done
int first= 1;
You can use a PL/SQL block to display numbers from 1 to n in Oracle. Here's an example program: DECLARE n NUMBER := 10; -- Change this value to your desired n BEGIN FOR i IN 1..n LOOP DBMS_OUTPUT.PUT_LINE(i); END LOOP; END; / This code declares a variable n, then uses a FOR loop to iterate from 1 to n, printing each number using DBMS_OUTPUT.PUT_LINE. Make sure to enable output in your SQL environment to see the results.
nr\m;laeoh9y0m g.qthnedxc In fortran: do i=1,5 write(6,*)i enddo stop end This program will write the numbers 1 to 5 on the screen.
printf("1 3 5 7 9\n");