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 |
State two uses of pointers in C?
What is structure packing ?
Explain the priority queues?
largest Of three Number using without if condition?
What is a macro in c preprocessor?
Explain what are reserved words?
C program to perform stack operation using singly linked list
what will be the output: main(){char ch;int a=10;printf("%d",ch);}
36 Answers Accenture, TCS, Wipro,
What is the collection of communication lines and routers called?
Write a code to reverse string seperated by spaces i/p str=India is my country o/p str=aidnI si ym yrtnuoc After writing code, optimize the code
What is #include conio h?
write a program in C to swap two variables