#include
#include
void main()
{
int sum_sqr(int n);
clrscr();
printf("%d",sum_sqr(5));//Sum of first 5 natural numbers' square values
getch();
}
int sum_sqr(int n)
{
int i,sum=0;
for(i=1;i<=n;i++)
{
sum=sum+(i*i);
}
return sum;
}
output:
55
#include
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.
Write an. Algorthim. To. Find the. Sum. Of. First15 natural. Numbers
write a lex program to delete space from the program
First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.
#include
No.First of all, you can't write negative numbers as sums of perfect squares at all - since all perfect squares are positive.Second, for natural numbers (1, 2, 3...) you may need up to 4 perfect squares: http://en.wikipedia.org/wiki/Lagrange's_four-square_theoremNo.First of all, you can't write negative numbers as sums of perfect squares at all - since all perfect squares are positive.Second, for natural numbers (1, 2, 3...) you may need up to 4 perfect squares: http://en.wikipedia.org/wiki/Lagrange's_four-square_theoremNo.First of all, you can't write negative numbers as sums of perfect squares at all - since all perfect squares are positive.Second, for natural numbers (1, 2, 3...) you may need up to 4 perfect squares: http://en.wikipedia.org/wiki/Lagrange's_four-square_theoremNo.First of all, you can't write negative numbers as sums of perfect squares at all - since all perfect squares are positive.Second, for natural numbers (1, 2, 3...) you may need up to 4 perfect squares: http://en.wikipedia.org/wiki/Lagrange's_four-square_theorem
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.
10 CLS 20 FOR n = 1 to 10 30 PRINT n, n^2, n^3 40 NEXT n 50 PRINT: PRINT: PRINT "Touch 'x' to go again, any other key to end." 60 INPUT a$ 70 IF a$ = "X" or a$ = "x" THEN 10 80 END
Write an. Algorthim. To. Find the. Sum. Of. First15 natural. Numbers
write a lex program to delete space from the program
write an assembly language program to find sum of N numbers
First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.
write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html
fdsgfhgdfhgdf
How to write a program for mouse in microprocessor?
program to find maximum of two numbers using pointers