write a program that input four digit number and find how
many 7 that number contains
Answer Posted / vitthal kadam
#include<iostream.h>
int main ()
{
int num,cnt,temp;
char ch;
cout<< "Enter any number in between [0-99999]: ";
cin >> num;
temp = num;
cnt = 0;
while (temp)
{
if (temp%10 == 7)
cnt++;
temp = temp/10;
}
cout<<"count of 7 in the entered number is " << cnt ;
cin>>ch;
return 0;
}
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
How stl is different from the c++ standard library?
What is meant by stl in c++?
How connect plc and pc through software
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
what is template and type convertion
Is stl part of c++ standard?
What is stl language?
Is there any error below, its a code to delete all entires from a map #include
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What is a stl vector?
What does stl mean in slang?
What does stl stand for in basketball?
What are the various types of stl containers?
Is stl open source?
a program using one dimensional array that searches a number if it is found on the list of given input numbers given by the user and locate its exact location in the list.