c program to manipulate x=1+3+5+...+n using recursion
Answers were Sorted based on User's Feedback
Answer / boni ravi
#include<stdio.h>
#include<conio.h>
main()
{
int i,n;
int x=0;
clrscr();
printf("enter n value");
scanf("%d",&n);
for(i=1;i<=n;i=i+2)
{
x=i+x;
}
printf("output is%d",x);
}
| Is This Answer Correct ? | 9 Yes | 10 No |
Answer / naresh m
main()
{
int sum=0,i;
int p,n;
printf("enter value for n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
p=(i*2-1);
sum=sum+p;
}
printf("sum is %d",sum);
}
| Is This Answer Correct ? | 2 Yes | 5 No |
How the processor registers can be used in C ?
How to convert decimal to binary in C using recursion??
how to print this pyramid * * * * * * * * * * * * *
What is ctrl c called?
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
Determine the result of performing two successive block transfers into the same area of a frame buffer using the binary arith operations
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
What is the use of gets and puts?
Write a c program to enter a string of paragraph and replacing a particular word which is repeated in the paragraph by another word?
2 Answers ME, Synfusion, Wipro,
palindrome for strings and numbers----Can anybody do the prog?
6 Answers CTS, TCS, Vipro Lifescience Pvt,
What is break statement?