Advertisement
6_2008-2009 Miscellaneous #216698

the programme

it displays the sum of digits of any no.

AI

AI 摘要: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

源代码
original-source
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
long int n,c,a,e;
int sum=0,d,i;
printf("enter any no.and no.of digits");
scanf("%ld",&n);
scanf("%d",&d);
for(i=0;i<d;i++)
{
sum=sum+(n/10^i)%10;
}
printf("the sum of digits is %d",sum);
getch();
}
原始评论 (3)
从 Wayback Machine 恢复