- Messages
- 429
- Reaction score
- 0
- Points
- 26
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
^
'\n' Kasi considered sya as one character, if I'm not mistaken. Escape sequence lang yung \ db.
Hindi mo ba ididisplay yan? Wala akong nakitang pang-display sa code mo eh. O_O
Tapos gawa ka function na isa pa for displaying number. Parameters mo yung minNum, maxNum, divisible.
For loop lang yan. Set i = minNum, i<=maxNum, i++
tapos sa loop ng for loop, if(i%divisible == 0), cout mo yung i
Eto yung pinaka-importanteng part. ikaw na bahala mag-edit
cout mo na lang yung counter sa labas ng for loop
May other way pa para gawin yan. I-recursion mo. e di ko kaya yon kaya di ako nag recursion hahaha
^
'\n' Kasi considered sya as one character, if I'm not mistaken. Escape sequence lang yung \ db.
Hindi mo ba ididisplay yan? Wala akong nakitang pang-display sa code mo eh. O_O
Gawa ka function for getting the lowest and highest number, isama mo na don yung divisible.Mga kuya at ate pa help naman po nito. di ko na alam ang gagawin ko sa turbo c++ , pagawa naman po ng sourcecode nito sa c++ , project po namin yan please help para po pumasa
Assume a range of integer valves starting from N1 and N2. Assume also an integer say M. Write a program that will print and display all the numbers from N1 to n2 w/c are divisible by M. You are also required to display the count of each number. For example, if N1=4, N2=12 and M=4, the output will be: 4,8,12. The valve 3 will also be displayed indicating that there are 3 numbers which are divisible by 4.
pa help naman po please . tnx po sa tutulong sa akin.
Tapos gawa ka function na isa pa for displaying number. Parameters mo yung minNum, maxNum, divisible.
For loop lang yan. Set i = minNum, i<=maxNum, i++
tapos sa loop ng for loop, if(i%divisible == 0), cout mo yung i
Eto yung pinaka-importanteng part. ikaw na bahala mag-edit
Code:
for(int i = num1; i <= num2; i++)
{
if (i%divi == 0)
cout<<i<<" is divisible by "<<divi<<endl;
counter++
}
May other way pa para gawin yan. I-recursion mo. e di ko kaya yon kaya di ako nag recursion hahaha
Last edited: