itc c++

can any one please dry run this code


#include<iostream>
using namespace std;
int main()
{
intnum,factor=1,temp;
cout<<"Enter any integer value"<<endl;
cin>>num; //number given by the user is 10123.
temp=num;
while(num>0)
{
num=num/10;
factor=factor*10;
}

while(factor>1)
{
factor = factor/10;
cout<<temp/factor<<endl;
temp = temp % factor;
}
return 0;
}

  1. 👍 0
  2. 👎 0
  3. 👁 113
asked by javeria
  1. what, you don't have a c++ system?

    1. 👍 0
    2. 👎 0
    posted by Steve

Respond to this Question

First Name

Your Response

Similar Questions

  1. Programing

    Write a full program that reads in an arbitrary sequence of integers from the standard input, and writes them to the standard output in sorted order and with all duplicates removed. You may assume the input contains at most 100

    asked by Anonymous on April 1, 2014
  2. C++

    I am trying to create a program that displays shipping charges for two region codes. The region code has to have exactly 3 characters (the letter A or B followed by two numbers). Display a message if invalid region code is

    asked by Anon on October 6, 2016
  3. computer science

    9.10: Reverse Array Write a function that accepts an int array and the array’s size as arguments. The function should create a copy of the array, except that the element values should be reversed in the copy. The function should

    asked by Cheryl on February 18, 2012
  4. C++ Programming

    I have to redo programming exercise 5 of chapter 9 using dynamic arrays. but I have the information but I don't know how to use it in a dynamic arrays please help. //Chapter 9: Programming Exercise 5 #include #include #include

    asked by Chamell Williams on September 28, 2008
  5. Computer Science

    Please suggest corrections to this code: why isn't the loop continuing ANY help is appreciated! #include #include using namespace std; int main () { double slope; int yint; int x; double cord; double coordinate(int x, double

    asked by Olivia on October 23, 2017
  6. programming C++

    Write a program that reads test scores up to 30 into an array. sentinel will stop when -1 is entered. Write functions that: 1. read the scores into arrays 2. computes the distribution based on whether they are As, Bs and so on 3.

    asked by Erika on February 9, 2012
  7. Fund of programming 1

    Complete the following C++ program. The program should compute and output the Celsius value corresponding to the given Fahrenheit value. //************************************************ // Celsius program // This program outputs

    asked by Anonymous on December 13, 2012
  8. Computers

    //program that puts two lists in order in one single list with all the numbers in order import java.util.Scanner; public class listOrder { public static void main (String [] args){ int [] list1; int [] list2; int [] list3; int

    asked by Pedro on October 1, 2009
  9. Computer Science

    //program that puts two lists in order in one single list with all the numbers in order import java.util.Scanner; public class listOrder { public static void main (String [] args){ int [] list1; int [] list2; int [] list3; int

    asked by Pedro on October 1, 2009
  10. C code

    Write a .c file named calc that: - Takes arguments from the command line - Solves a simple math problem - Returns the result as an exit status calc.c: //this is the function that gets called when the executable is run. int

    asked by Nick on February 6, 2013

More Similar Questions