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

Who created stl?

742


How do I convert a stl file?

643


What is stl stack?

745


How does an stl file work?

746


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

2425






Name the different types of stl containers.

788


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

1733


Who wrote stl?

786


How do you convert stl to steps?

718


i wanted to know about questions about c,c++ , which is required for placements.... im a fresher

1793


Explain stl.

982


How is stl different from c++ standard library?

845


Is there any error below, its a code to delete all entires from a map #include #include iostream.h int main() { int i =0; map TestMap; while(i<3) { TesMap.insert(TestMap::value_type(i,Test)); i++; } typedef map :: iterator mapIter =TestMap.begin(); if(mapIter!=TestMap.end()) { TestMap.erase(mapItrer); ++mapIter; } return 0; }

1998


how to use C++?

2154


What is stl in oop?

805