#include<iostream.h>
#include<conio.h>
void main()
{
for(int i=1;i<=10;i++)
{
cout<<i*i;
}
getch();
}
First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
You first learn how to program in C.
first think of the logic and then write the statements
#include<iostream> int main() { int i=0; while(i++<10) std::cout<<i*i<<std::endl; }
First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.
To write a program in QBASIC to find the area of a square, you first need to prompt the user to enter the length of one side of the square. You can then calculate the area by squaring the length (multiplying it by itself) and finally display the result. Here's a simple example: INPUT "Enter the length of the side of the square: ", side area = side * side PRINT "The area of the square is: "; area
For first find an example program.
int first= 1;
No, it is not possible.
Algorithm: multiples input: two positive integers, m and n output: print first n multiples of m i = m; for j = 1 to n print i i = i + m; next j
To write a set of negative integers, you use curly braces and list the integers, often starting from -1 and going downwards. For example, the set of the first five negative integers can be written as {-1, -2, -3, -4, -5}. If you want to represent all negative integers, you can denote the set as {x ∈ ℤ | x < 0}, meaning all integers x that are less than zero.
public class sum { public static void main(String args[]){ int sum=0; for(int i=1;i<=10;i++){ sum=sum+i; } System.out.println(sum); } }
Very interesting !If you write the counting numbers from 1 to 1,000,000,you'll write the digit '9' exactly 600,000times.
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
You first learn how to program in C.
first think of the logic and then write the statements