[Let Us C Solutions ] C Program To Find The Sum Of Five Digit Number



Code :-


#include<stdio.h>
#include<conio.h>
#include<windows.h>

void main(){

int nu,rem,sum=0,cnu;

system("cls");

printf("\n\n\t\tSUM OF FIVE DIGIT");
printf("\n\n\t\tENTER 5 DIGIT NUMBER  : ");
scanf("%d",&nu);
cnu=nu;

rem=nu%10;
sum=sum+rem;
nu=nu/10;

rem=nu%10;
sum=sum+rem;
nu=nu/10;

rem=nu%10;
sum=sum+rem;
nu=nu/10;

rem=nu%10;
sum=sum+rem;
nu=nu/10;

rem=nu%10;
sum=sum+rem;
nu=nu/10;

printf("\n\n\t\tSUM OF %d NUMBER  : %d",cnu,sum);

getch();
}


Download Files



Comments

Popular posts from this blog

HTML Signup Login Form With Source Code