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 |
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }
what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16
#include <stdio.h> int main(void) { int a=4, b=2; a=b<<a+b>>2 ; printf("%d",a); return 0; }
main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); printf("%f\n",f<<2); printf("%lf\n",f%g); printf("%lf\n",fmod(f,g)); }
Give a oneline C expression to test whether a number is a power of 2?
25 Answers EA Electronic Arts, Google, Motorola,
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }
#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }