# Programming Interview Questions

Sub Category
Questions
Last Updated
60
267
Nov 27th, 2018
23
37
Jul 14th, 2017
26
41
Apr 5th, 2018
27
29
Jul 25th, 2017
66
248
May 21st, 2018
101
523
Mar 25th, 2018
25
86
Sep 11th, 2018
63
78
Nov 21st, 2017
21
27
Apr 27th, 2017
46
125
Feb 3rd, 2016

Showing Questions 41 - 42 of 42 Questions
First | Prev | Next | Last Page
Sort by:
|
•

#### gaurav kumar jaiswal

• Aug 31st, 2014

Write a c++ program to the sum and product of digits of an integers

#### karuna gaur

• Apr 15th, 2013

456 sum is 15

```Codeint sumDigits(int n) {
int sum = 0;

while( n > 0 ) {
sum += (n % 10); // add last digit of n to sum
n /= 10; // divide n by 10 to "chop off" the last digit
}

return sum;

getch();
}```

•

#### Print Sum of Digits

Write a function to print sum of the digits in a given integer n without converting it to String. For example : if n = 1234 the function should return 1+2+3+4 = 10 if n = 15 the function should return 1+5 =6 if n = 5 the function should return 5.

#### sravani reddy

• Sep 21st, 2017

```Code#include<stdio.h>
int main()
{
int rem,sum=0,n;
printf("enter the number:");
scanf("%d
",&n);
while(n!=0)
{
rem=n%10;
sum=sum+rem;
n=n/10;
}
printf("the sum of digits of a number is %d",sum);
return 0;
}```

#### Shasan

• Mar 29th, 2016

"c# public static int Sum() { int n = 1235678; int n1 = 0; int f = 0; while (n!= 0) { ...

Showing Questions 41 - 42 of 42 Questions
First | Prev | Next | Last Page
Sort by:
|  