write a program that input four digit number and find how
many 7 that number contains

Answer Posted / ruchi

#include<stdio.h>
#include<conio.h>
int main()
{
int num,n,i=0,p;
printf("\nEnter the number ");
scanf("%d",&num);
while(num>0)
{
n=num%10;
p=num/10;
num=p;
if(n==7)
{
i++;
}
}
printf("\nthe total number of occurence of the digit 7
is %d",i);
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does an stl file work?

662


Do you like to Submit Questions in Bulk under Same Category?? Then use our Bulk ListerDo you like to Submit Questions in Bulk under Same Category?? Then use our Bulk Lister

1671


help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase

1893


What is stl in c++ with example?

644


Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.

1652






What are stl algorithms?

635


When did c++ add stl?

749


What is the stl, standard template library?

600


what is template and type convertion

2004


In what scenario does the Logical file and Physical file being used?

2334


Can we use stl in coding interviews?

1292


Who wrote stl?

687


To modify an, existing worksheet. What steps are involved for: 1. Inserting and deleting rows and columns. 2. Printing cell formulas 3Jld displayed values 3. Using the page setup command

1787


What is meant by stl in c++?

664


What are the various types of stl containers?

742