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
Explain can static variables be declared in a header file?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
Explain the red-black trees?
Wt are the Buses in C Language
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
I need testPalindrome and removeSpace
#include
What is the difference between procedural and declarative language?
Does c have an equivalent to pascals with statement?
Write a program to find the biggest number of three numbers in c?
What are the 5 organizational structures?
int i=10; printf("%d %d %d", i, i=20, i);
Write the test cases for checking a variable having value in range -10.0 to +10.0?
What is the meaning of c in c language?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
Explain how can you determine the size of an allocated portion of memory?