HI ALL ! i think all here are newbies and need not only some help but the most important is to benefit and learn, i appreciat what did. look boat26guy , i know that u r new in programing and it is not a problem but u should depend on urself in most cases as beginner, i mean the way u ask for help is somehow wrong( sorry for this) if u got a program to solve, solve it first in ur way then if u got any difficult ask for help this way i garanty ur to improv so fast in programing, but if u depend on the other code then do urs :(.....
so as a friend i just wanna advice to try to solve the code first then if u face any problem we can discus it or show us what u did, this way u ll realy undrestand and compare the ohter code and ur so u ll see what are u mistake.
sorry for this but just an advice as a friend hope no feeling hurt ;).
:).
loook first if u have a program try to think about it, forget that it is a progarm and try to solve it in simple way, i mean their is something call ALGORITHM if u realy wanna learning programing,
ur program is so simple
in this program thier are only 4-digits to be display 1per line so u should be careful here and u want to display each digits per line, first think how to get the digits how to separat them and, their is difference btwn 4-digits and 4 numbers...4-digit ==1234 (the 4 number should not be separeted) ,but 4 number == 1 2 3 4
i ll help u in this code but promess me next time to solve and try first befor ask ok :).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include<iostream>
using namespace std;
int main()
{
int num ,n1, n2, n3, n4, remainder;
cout<<"Enter the four-integer digit ";
cin>> num;
if (num>9999 || num <1000)
cout<<"sorry enter 4 integer digit please "<<endl;
else
{
n1 = num / 1000;
remainder = num % 1000;
n2 = remainder / 100;
remainder = remainder % 100;
n3 = remainder /10;
remainder = remainder %10;
n4 = remainder;
cout<<"The 4-digit u enter are "<<num<<endl;
cout<<"The 4-digit each per line \n";
cout<<n1 <<endl;
cout<<n2 <<endl;
cout<<n3 <<endl;
cout<<n4 <<endl;
}
return 0;
|
i will not explain anything to see if u realy undrestand or no just to show that u depend more on urself. look im doing this jus to help u being good enough so hope that u ll not misundrestand me ;).
i ll be more happy if u ask for any detail or explantion about the things u didnt undrestand in my code :)
hope i was helpful :).