C program to find sum of digits of the entered number. Get link Facebook X Pinterest Email Other Apps September 01, 2020 Program :#include<stdio.h>#include<conio.h>void main(){ int i,a,s=0; clrscr(); printf("Enter any number\n"); scanf("%d",&a); while(a) { i=a%10; a=a/10; s=s+i; } printf("The sum of digits is %d",s); getch();}Output : Get link Facebook X Pinterest Email Other Apps Comments
Comments
Post a Comment