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 |
What is the use of pragma in embedded c?
Do pointers store the address of value or the actual value of a variable?
Write a program that will read the input of any number of digits n in a row of shafh showing the breakdown of the printing and printing figures by the recursive function.
write a own function for strstr
What is a void pointer in c?
What is wrong with this code such that it doesnt produce the input reversed? #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char Space = ' '; char LineOfText; float count; LineOfText = getchar(); while ((LineOfText = getchar()) != '/n'); { count = strlen(LineOfText) - 1; while (count >= 0) { putchar(LineOfText[count]); count--; } } getchar(); return 0; }
If fflush wont work, what can I use to flush input?
main() { int l=6; switch(l) { default:l=l+2; case 4:l=4; case 5:l++; break; } printf("%d",l); }
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
declare afunction pointer to int printf(char *)?
What are keywords c?
10. Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning