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 |
write a c program to check weather a particluar bit is set or not?
how to write a program which adds two numbers without using semicolon in c
in b=6.6/a+(2*a+(3*c)/a*d)/(2/n); which operation will be performed first a) 6.6/a b) 2*a c) 3*c d) 2/n
write a program in C to swap two variables
What are disadvantages of C language.
write a program for fibonaci series by using while loop in c?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
how can write all 1to 100 prime numbers using for loop,if and break ?
Is both getch() and getchar() functions are similar? if it is similar means why these two functions are used for same usage? if it is not similar means what is the difference?
Write a code of a general series where the next element is the sum of last k terms.
What is the purpose of scanf() and printf() functions?
WAP to accept first name,middle name & last name of a student display its initials?