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 remove all the duplicate characters in a string and replace with single character? ex:-input- AAABBBCCC output- ABC
How are 16- and 32-bit numbers stored?
wat is the output int main() { char s1[]="Hello"; char s2[]="Hello"; if(s1==s2) printf("Same"); else printf("Diff"); }
What is wild pointer in c?
why TCS selected more student in the software field from all institution.
write a program to find a given no. is divisible by 3 or not without using any arthimetic operators?
where does malloc() function get the memory?
What are the advantages of using new operator as compared to the function malloc ()?
triangle number finding program...
Explain about the functions strcat() and strcmp()?
write a program to convert a expression in polish notation (postfix) to inline (normal)
Describe the difference between = and == symbols in c programming?