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
What are local static variables? How can you use them?
What do you mean by a sequential access file?
What is difference between array and pointer in c?
Write a program to check palindrome number in c programming?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
What are local variables c?
What is a 'null pointer assignment' error?
What is conio h in c?
What is the stack in c?
What are the rules for the identifier?
Can true be a variable name in c?
What is difference between structure and union in c?
What is zero based addressing?
List the different types of c tokens?
What is operator promotion?