There is a lucky draw held every day.
if there is a winning number eg 1876,then all possible
numbers like 1867,1687,1768 etc are the numbers that match
irrespective of the position of the digit.
Thus all these numbers qualify fr the lucky draw prize
Assume there is no zero digit in any numbers.
write a program to show all the possible winning numbers if
a "winning number"is passed as an arguments to the function.
Answer / guest
void main()
{
int sum=0,mul=1,s=0,m=1,i,t,nn,j=1;
clrscr();
printf("Enter number without '0' as its digit
\n");
scanf("%d",&nn);
while(nn>0)
{
sum=sum+(nn%10);
mul=mul*(nn%10);
nn=nn/10;
j=j*10;
}
printf("j %d sum %d mul %d",j,sum,mul);
for(i=j/10;i<j;i++)
{ t=i;
while(t>0)
{
s=s+(t%10);
m=m*(t%10);
t=t/10;
}
if(s==sum && mul==m)
printf("\n%d",i);
s=0;
m=1;
}
getch();
}
| Is This Answer Correct ? | 11 Yes | 2 No |
void main() { char ch; for(ch=0;ch<=127;ch++) printf(ā%c %d \nā, ch, ch); }
how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!
why is printf("%d %d %d",i++,--i,i--);
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }
write a c program to Reverse a given string using string function and also without string function
main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000
What are segment and offset addresses?
main() { clrscr(); } clrscr();
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns