what is the code of the output of print the 10 fibonacci
number series
Answers were Sorted based on User's Feedback
Answer / arun asokan
#include<stdio.h>
#include<conio.h>
void main()
{
int a=0,b=1,c,limit=8;
clrscr();
printf("%d\t%d",a,b);
for(n=1;n<=limit;n++)
{
c=a+b;
a=b;
b=c;
printf("\t%d",c);
}
getch();
}
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / prassatharun
#include<stdio.h>
void main()
{
int a=0,b=1,c,limit=10,n=1;
clrscr();
printf("%d\n%d",a,b);
while(n<=limit)
{
c=a+b;
a=b;
b=c;
printf("\n%d",c);
n++;
}
getch();
}
Is This Answer Correct ? | 0 Yes | 2 No |
write a c program to print magic square of order n when n>3 and n is odd?
main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }
write a program to Insert in a sorted list
main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O
void main() { int i=i++,j=j++,k=k++; printf(ā%d%d%dā,i,j,k); }
Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above
How can u say that a given point is in a triangle? 1. with the co-ordinates of the 3 vertices specified. 2. with only the co-ordinates of the top vertex given.
#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }