c program to manipulate x=1+3+5+...+n using recursion
Answer Posted / 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 |
Post New Answer View All Answers
What are types of structure?
What are actual arguments?
what are enumerations in C
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
What is operator precedence?
What is uint8 in c?
Why c is called object oriented language?
How many levels of pointers have?
Why isnt any of this standardized in c?
What is array of pointers to string?
What is fflush() function?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
What is spaghetti programming?
What is pass by value in c?
Explain how do you determine a file’s attributes?