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 |
#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }
void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print
Printf can be implemented by using __________ list.
write the function. if all the character in string B appear in string A, return true, otherwise return false.
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }
#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
prog. to produce 1 2 3 4 5 6 7 8 9 10
what is the output of following program ? void main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); }
why array index always strats wuth zero?