answersLogoWhite

0


Best Answer
Answer:CODE:

#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:#include

int main (void) { puts ("1 4 9 16..100"); retun 0; }

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

#include<stdio.h>

#include<conio.h>

void main()

{

int num[10],i,j,temp;

clrscr();

printf("\n Enter 10 values of an array.....\n");

for(i=0;i<10;i++)

scanf("%d",&num[i]);

printf("\n array before sort ....\n");

for(i=0;i<10;i++)

printf("%d\t",num[i]);

for(i=0;i<9;i++)

{

for(j=i+1;j<10;j++)

{

if(num[i]<num[j])

{

temp=num[i];

num[i]=num[j];

num[j]=temp;

}

}

}

printf("\n array after sort .........\n");

for(i=0;i<10;i++)

printf("%d\t",num[i]);

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

#include<iostream>

int main()

{

for(int i=1;i<=10;++i)

std::cout<<++i<<std::endl;

return(0);

}

Alternatively:

#include<iostream>

int main()

{

int i=0;

while(i<10)

std::cout<<++i<<std::endl;

return(0);

}

Alternatively:

#include<iostream>

int main()

{

int i=0;

do{

std::cout<<++i<<std::endl;

}while(i<10);

return(0);

}

Alternatively:

#include<iostream>

int main()

{

repeat:

int i=0;

std::cout<<++i<<std::endl;

if(i<10)

goto repeat;

return(0);

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

void main()

{

int i,num=1;

clrscr();

while(num<=100)

{ i=2; while(i<=num)

{ if(num%i==0)

break;

i++; }

if(i==num)

printf("\n%d is Prime",num);

num++;

}

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

There are many ways to write it. I give you a few example of it. You can follow which will easy for you.

=> Using for loop:

#include <stdio.h>

main(void)

{

int i;

for(i = 1; i <= 10; i++)

{

printf("%d ", i);

}

}

=> Using While loop:

#include <stdio.h>

main(void)

{

int i = 1;

while(i <= 10)

{

printf("%d ", i);

i++;

}

}

=> Using d0-while loop:

#include <stdio.h>

main(void)

{

int i = 1;

do

{

printf("%d ", i);

i++;

} while(i <= 10);

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

#include <iostream>

int main()

{

for( unsigned int i = 1; i < 11; ++i )

{

std::cout << i << std::endl;

}

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a c program to display 1 4 9 16..100?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program in shell script to display odd number from 0 to 100?

seq 1 2 99


How can I write a program to display prime numbers from 1 to 100?

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.


How many sq m in 230 centimeters by 70 centimeters?

we can find the product=230 X70 =16100 cm sq. 1 sq.m =10000 sq.cm. 16100 sq.cm=1.61 m&sup2; .


Write a java program to display the number is prime or not?

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 C program to print the following series 112 122 . 1n2?

write a program to print the series 1/12+1/22+.........+1/n2 ?


What BASIC program can compute and display all prime numbers from 1 to 40?

PRINT 2,3,5,7,11,13,17,19,23,29,31,37


Write a program to display table of five in unix?

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


Write a program to calculate first?

int first= 1;


Program that display the first 5 odd numbers?

printf("1 3 5 7 9\n");


Write a cobol program to find prime number or not?

Identification division. Program-id. Prime. Environment division. Data division. Working-storage section. 77 n pic 9(3). 77 q pic 9(3). 77 r pic 9(3). 77 i pic 9(3) value 1. Procedure division. Para-a. Display ( 1 , 1 ) erase. Display ( 2 , 1 ) "enter an integer:". Accept ( 2 , 20 ) n. If n = 1 display ( 3 , 1 ) "number is not prime" go to stop-para. Para-b. Add 1 to i. If i = n display ( 3 , 1 ) "number is prime" go to stop-para. Divide n into i giving q remainder r. If r = 0 display ( 3 , 1 ) "number is not prime" go to stop-para. Go to para-b. Stop-para. Stop run.


Can you give me a program that will compute number 1 to 5?

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.


Write a program in vbscript to display a multiplication table in web page?

Option explicit Dim val,indx val=inputbox("enter any number") For indx= 1 to 10 print val&amp;"*"&amp;indx&amp;"="&amp;val&amp;"*"indx Next