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 is the difference between single charater constant and string constant?
What are local static variables? How can you use them?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
how to create duplicate link list using C???
What is the size of structure pointer in c?
What is the use of pointers in C?
Is sizeof a keyword in c?
How do you sort filenames in a directory?
can any one tel me wt is the question pattern for NIC exam
Difference between goto, long jmp() and setjmp()?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
Who developed c language?
What is the size of enum in bytes?
What is the easiest sorting method to use?
Write a program of prime number using recursion.