wap in c to accept a number display the total count of digit
Answers were Sorted based on User's Feedback
Answer / vaibhav
#include<stdio.h>
#include<conio.h>
void main()
{
int no,t,cnt=0;
clrscr();
printf("\n enter the no.");
scanf("%d",&no);
while(no!=0)
{
t=no%10;
no=no/10;
cnt++;
}
printf("\nTotal count of digit is%d",cnt);
getch();
}
| Is This Answer Correct ? | 19 Yes | 4 No |
#include<stdio.h>
#include<conio.h>
int main()
{
int number,m,sum =0,count =0;
printf("Enter the number \n");
scanf("%d",&number);
while(number != 0)
{
m = number % 10;
sum = sum + m;
count++;
number = number / 10;
}
printf("\nThe number of Digits in the Given Number is
%d\n",count);
printf("The Sum of Digits in the Given Number is %d\n",sum);
}
| Is This Answer Correct ? | 19 Yes | 5 No |
Answer / govind279
#include<stdio.h>
int main()
{
int n,m,sum=0;
scanf("%d",&n);
for(m=0;((m=n%10)!=0);n=(n/10))
sum+=m;
printf("count is %d\n",sum);
}
| Is This Answer Correct ? | 14 Yes | 10 No |
Answer / sashidharan
main()
{
int n,count=0;
scanf("%d",&n);
for(i=0;i<=n;i++)
{
count=count+1;
}
printf("total count of digit",count);
}
| Is This Answer Correct ? | 22 Yes | 20 No |
What is C++
What do you mean by a local block?
Dont ansi function prototypes render lint obsolete?
What is the use of gets and puts?
in b=6.6/a+(2*a+(3*c)/a*d)/(2/n); which operation will be performed first a) 6.6/a b) 2*a c) 3*c d) 2/n
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
what is the definition of storage classes?
create an SINGLE LINKED LISTS and reverse the data in the lists completely
Why is %d used in c?
1)what are limitations for recursive function? 2)write a program to read a text file and count the number of characters in the text file
wap in c to accept n number display the highest and lowest value
What does double pointer mean in c?