Write an algorithm for a program that receives an integer as
input and outputs
the product of of its digits. E.g. 1234 = 24, 705 = 0

Answer Posted / krishna

#include<stdio.h>
#include<conio.h>
void main()
{
int n,n1.p=1;clrscr()printf("\n enter num");scanf("%d",&n);
while(n>0){ n1=n%10;p=p*n1;n=n/10;}printf("\n required answer is %d",p);
getch();
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are local static variables? How can you use them?

644


What do you mean by a sequential access file?

624


What is difference between array and pointer in c?

534


Write a program to check palindrome number in c programming?

596


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

703






What are local variables c?

548


What is a 'null pointer assignment' error?

723


What is conio h in c?

622


What is the stack in c?

714


What are the rules for the identifier?

667


Can true be a variable name in c?

555


What is difference between structure and union in c?

544


What is zero based addressing?

707


List the different types of c tokens?

621


What is operator promotion?

626