Write a program to check whether the number is prime and also
check if it there i n fibonacci series, then return true
otherwise return false
Answer / surendra
include<stdio.h>
int main(){
int k,r;
long int i=0l,j=1,f;
//Taking maximum numbers form user
printf("Enter the number range:");
scanf("%d",&r);
printf("FIBONACCI SERIES: ");
printf("%ld %ld",i,j); //printing firts two values.
for(k=2;k<r;k++){
f=i+j;
i=j;
j=f;
printf(" %ld",j);
}
return 0;
}
| Is This Answer Correct ? | 3 Yes | 4 No |
Sir... please give some important coding questions asked by product companies..
how to test pierrot divisor
Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.
What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
Design an implement of the inputs functions for event mode
How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above
4 Answers Corporate Society, HCL,
can u give me the c codings for converting a string into the hexa decimal form......
Finding a number multiplication of 8 with out using arithmetic operator
how to delete an element in an array
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
Develop a routine to reflect an object about an arbitrarily selected plane