Write a c program for sum of first n terms of the series
S = 1 - (1/3) + (1/5) -(1/7) + (1/9) ......
Answers were Sorted based on User's Feedback
Answer / amitabha mukhopadhyay
void main()
{
int i,n,sum;
printf("enter n");
scanf("%d",&n);
for(i=1,i<=n,i++)
{
sum=1;
sum=sum+(-1,i)*1/(2i+1));
printf("sum=%d");
}
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / lavanya
void main()
{
int i,n,sum;
printf("enter n");
scanf("%d",&n);
for(i=1,i<=n,i++)
{
sum=1;
sum=sum+(1%(2i+1));
printf("sum=%d");
}
Is This Answer Correct ? | 0 Yes | 1 No |
write an algorithm and a program to count the number of elements in a circularly singly linked list
how to add numbers without using arithmetic operators.
Can you add pointers together? Why would you?
What is d'n in c?
Explain what is a pragma?
What is double pointer in c?
why division operator not work in case of float constant?
int *p=20; if u print like dis printf("%d",p); o\p:- 20; how is it possible? plz give me the explanation.
what is y value of the code if input x=10 y=5; if (x==10) else if(x==9) elae y=8; a.9 b.8 c.6 d.7
What is the difference between arrays and pointers?
how can i include my own .h file EX:- alex.h like #include<alex.h>, rather than #include"alex.h"
int i=0,j; j=++i + ++i ++i; printf(" %d",j);