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 char array and char pointer?
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
Why is c faster?
What does void main return?
What is the difference between pure virtual function and virtual function?
Why doesnt the call scanf work?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
What is #include conio h?
Which is an example of a structural homology?
What are dangling pointers in c?
When should structures be passed by values or by references?
What does the message "automatic aggregate intialization is an ansi feature" mean?
What is New modifiers?
What are global variables and how do you declare them?
why wipro wase