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
Is stl open source?
How is stl different from c++ standard library?
Can we use stl in coding interviews?
How do you convert stl to steps?
What is stl stand for?
What does stl mean in slang?
What are the different types of stl containers?
What two types of containers does the stl provide?
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.
Is there any error below, its a code to delete all entires from a map #include
write a program that will accept a number and print.its equivalent in words the maximum input number is 9999
What is a standard template library (stl)? What are the various types of stl containers?
How connect plc and pc through software
In what scenario does the Logical file and Physical file being used?
totoo po ba ang manga aliens!