answersLogoWhite

0


Best Answer

class Abc

{

public static void main(String[] args)

{

System.out.println("Hello World!");

}

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to find square of number using do while loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


Is it possible to make a program using for and not with while?

The following cases are all possible:- program without any for and while- program without for- program without while- program with both for and while


Write a program using while loop?

//program to find the factorial value f any number using while loop #include<stdio.h> void main() { int i,n,fact=1; printf("Enter the number\n"); scanf("%d",&n); i=n; while (i>=1) { fact=fact*i; i--; } printf("The factorial value=%d",fact); } the above is a program for calculating tha factorial value of any number which is entered by the user


To find square root of a nos without using built in function?

/*Java program to find out square root of a given number * without using any Built-In Functions */ public class SquareRootDemo2 { public static void main(String[] args) { //Number for which square root is to be found double number = -12; //This method finds out the square root findSquareRoot(number); } /*This method finds out the square root without using any built-in functions and displays it */ public static void findSquareRoot(double number) { boolean isPositiveNumber = true; double g1; //if the number given is a 0 if(number==0) { System.out.println("Square root of "+number+" = "+0); } //If the number given is a -ve number else if(number<0) { number=-number; isPositiveNumber = false; } //Proceeding to find out square root of the number double squareRoot = number/2; do { g1=squareRoot; squareRoot = (g1 + (number/g1))/2; } while((g1-squareRoot)!=0); //Displays square root in the case of a positive number if(isPositiveNumber) { System.out.println("Square roots of "+number+" are "); System.out.println("+"+squareRoot); System.out.println("-"+squareRoot); } //Displays square root in the case of a -ve number else { System.out.println("Square roots of -"+number+" are "); System.out.println("+"+squareRoot+" i"); System.out.println("-"+squareRoot+" i"); } } }


What is a sqare whole number?

That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.


Where the data and program kept while the processor is using them?

In the RAM


Write a c program using while loop to accept a number check and display message whether number is perfect or not?

The program is here guys.......... //Finding whether the given number is perfect or not //Starts here #include<stdio.h> void main() { int i=1,temp=0,number; scanf("%d",&number); while(i<=number/2){ if(number%i==0) temp+=i; i++; } if(temp==number) printf("Its a perfect number"); else printf("Its not a perfect number"); } //ends here


C program algorithm for simple interest using while loop?

Not used


What is the role of internal reporting system while using the loyalty program?

eleporo


Using while loop Write a program find the factors of a number?

by this program you can find the factorial: #include<iostream> using namespace std; main() { int n,x,f=1; cin>> n; x=0; while(x<n) { x++; f= f*x; } cout<<"factorial is"<<f<<"\n"; system("pause"); return 0; }


Write a program that will graph using for loop?

A = 5do{statement;A = A + 1;} while (A < 10)


How do you write a c program to print n no's required using while loop?

int i=0; while (i++&lt;n) { /*...*/ }