c program to find the sum of given number
C
Enter the number
300
Given number = 300
Sum of the digits 300 = 3
Enter the number
16789
Given number = 16789
Sum of the digits 16789 = 31# include<stdio.h>
int main
{
int number;
int sum=0;
int remainder;
printf("enter a number\n");
scanf("%d",&number);
for(;number!=0;)
{
remainder=number%10;
sum=sum+remainder;
number=number/10;
}
printf("sum of digits=%d",sum);
}
Also in C:
- Title
- bubble sort time complexity
- Category
- C
- Title
- char to int c
- Category
- C
- Title
- c defined value sum
- Category
- C
- Title
- pass the pointer in C
- Category
- C
- Title
- arduino digital read
- Category
- C
- Title
- random en c
- Category
- C
- Title
- oop244
- Category
- C
- Title
- c fill 2d array
- Category
- C
- Title
- fa fa-facebook
- Category
- C
- Title
- code wars responsable drinker
- Category
- C
- Title
- find string in all files powershell
- Category
- C
- Title
- remove element queue
- Category
- C
- Title
- passing 2d array as parameter to function in c
- Category
- C
- Title
- -> operator
- Category
- C
- Title
- c allocate array
- Category
- C
- Title
- c if int
- Category
- C
- Title
- code in c skipping over scanf
- Category
- C
- Title
- docker images command
- Category
- C
- Title
- xamarin command listview button
- Category
- C
- Title
- print integer to stdout using write or putchar?
- Category
- C
- Title
- generate all permutations of string
- Category
- C
- Title
- declare variable in c
- Category
- C
- Title
- '&&' within '||'
- Category
- C
- Title
- enum c
- Category
- C
- Title
- How to pull images from Docker Registry
- Category
- C
- Title
- es vocal
- Category
- C
- Title
- chat c socket tcp geeksforgeeks
- Category
- C
- Title
- arduino knn
- Category
- C
- Title
- add border to image android
- Category
- C
- Title
- powershell search big files
- Category
- C
- Title
- how to do Employing defensive code in the UI to ensure that the current frame is the most top level window
- Category
- C
- Title
- get current used proxy windows 7
- Category
- C
- Title
- docker run port mapping
- Category
- C
- Title
- msdos
- Category
- C
- Title
- function in c
- Category
- C
- Title
- strcat in c
- Category
- C
- Title
- how to ascii art in c
- Category
- C
- Title
- curl post request
- Category
- C
- Title
- time now c
- Category
- C
- Title
- v
- Category
- C
- Title
- use of matplotlib inline
- Category
- C
- Title
- inurl:fiu.edu math faculty
- Category
- C
- Title
- resto de division recursiva
- Category
- C
- Title
- pi in c language
- Category
- C
- Title
- is c and c++ platform independent
- Category
- C
- Title
- a enum data type in c with loop
- Category
- C
- Title
- iterate through map
- Category
- C
- Title
- how to represent unsigned char with % c
- Category
- C
- Title
- XAudio2 C
- Category
- C
- Title
- How to pass a struct value to a pthread in c?
- Category
- C
- Title
- ModuleNotFoundError: No module named 'easydict'
- Category
- C
- Title
- uint32_t extract first bits
- Category
- C
- Title
- uninstall elgg from hostgtor
- Category
- C
- Title
- what is x:Name Xamarin forms
- Category
- C
- Title
- read a binary file c
- Category
- C
- Title
- tar cmd
- Category
- C
- Title
- root in C
- Category
- C
- Title
- Declaring Variables in C
- Category
- C
- Title
- múltiplos entre dos numeros en c
- Category
- C
- Title
- boolean function c
- Category
- C
- Title
- slurm array job
- Category
- C
- Title
- diferencia entre * y & en c
- Category
- C
- Title
- mostrar lista recursiva
- Category
- C
- Title
- write a program to ask the user 8 integer numbers. your program will then move all negative elements of your array to the end of the array without changing the order of positive elements and negative elements
- Category
- C
- Title
- c pause for 1 second
- Category
- C
- Title
- write array of char to file in c
- Category
- C
- Title
- declare character array statically?
- Category
- C
- Title
- how to open chrome using cmd
- Category
- C
- Title
- command line arguments c
- Category
- C
- Title
- c check if char is number
- Category
- C
- Title
- printf in c
- Category
- C
- Title
- what is conio.h
- Category
- C
- Title
- download file by command line windows
- Category
- C
- Title
- strtok
- Category
- C
- Title
- duplicar cadena
- Category
- C
- Title
- atoi c
- Category
- C
- Title
- battlefield4u.com
- Category
- C
- Title
- sue murry
- Category
- C
- Title
- switch case c
- Category
- C
- Title
- remove an element from a set
- Category
- C
- Title
- iterar en map
- Category
- C
- Title
- latex font sizes
- Category
- C
- Title
- print variable c
- Category
- C
- Title
- c print array
- Category
- C
- Title
- get regedit value cmd
- Category
- C
- Title
- last element from list javascript
- Category
- C
- Title
- div
- Category
- C
- Title
- c vs python
- Category
- C
- Title
- docker logs follow
- Category
- C
- Title
- ModuleNotFoundError: No module named 'tensorboardX'
- Category
- C
- Title
- arduino digital io pins
- Category
- C
- Title
- what is stdin in c
- Category
- C
- Title
- how to put a struct in another struct C
- Category
- C
- Title
- potencia recursiva
- Category
- C
- Title
- c print hello world
- Category
- C
- Title
- update ubuntu in terminal
- Category
- C
- Title
- vbl share price
- Category
- C
- Title
- mitch mcconnell
- Category
- C
- Title
- how to check the size of a file c
- Category
- C
- Title
- does strcat null terminate
- Category
- C