Monday, September 9, 2019

Sum of five digit no. Sheet 1 sem 1

#include<stdio.h>
 main()
{
int N,sum,i;
printf("enter the five digit no...\n");
scanf("%d",&N);
sum=0;
for(i=1;i<=5;i++)
{
sum=sum+N%10;
N=N/10;

}
printf("sum of digit :%d\n",sum);
return 0;
}

No comments:

Implement stsStr Leetcode solution

  28.   Implement strStr() Easy Implement  strStr() . Given two strings  needle  and  haystack , return the index of the first occurrence of...