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 |
Difference between malloc() and calloc() function?
`write a program to display the recomended action depends on a color of trafic light using nested if statments
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
How can you increase the size of a dynamically allocated array?
Can a pointer be static?
prototype of sine function.
How can you find out how much memory is available?
What does p mean in physics?
implement general tree using link list
What are predefined functions in c?
c program to arrange digits in a no in ascending and descending order
write an algorithm and c program to add two 2x2 matrics