Write a program to add the following
¼+2/4+3/4+5/3+6/3+...
(Like up to any 12 no.s)
Answer / nitin garg
#include <stdio.h>
#include <conio.h>
int main()
{
float i,j,m=3,n=4;
float sum=0,fact=1;
for(i=1;i<=15;i++)
{
for(j=i;j<=m;j++)
{
sum=sum+(j/n);
printf("%f/%f +",j,n);
}
i=i+3;
m=m+4;
n--;
}
printf("
Sum of the series %f",sum);
getch();
}
| Is This Answer Correct ? | 4 Yes | 0 No |
How to Clear last bit if it 1 using Macro TURN_OFF_BIT_LAST
What is sizeof return in c?
how can u print a message without using any library function in c
int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i);
C program to find all possible outcomes of a dice?
write a program to display reverse of a number using for loop?
How many keywords are there in c?
can any one tell that i have a variable which is declared as static but i want this variable to be visible to the other files? how?
How will you divide two numbers in a MACRO?
What is the full form of getch?
What is openmp in c?
#define min((a),(b)) ((a)<(b))?(a):(b) main() { int i=0,a[20],*ptr; ptr=a; while(min(ptr++,&a[9])<&a[8]) i=i+1; printf("i=%d\n",i);}