Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

-= Having Difficulties in C++ and Java? Be a Part of This Thread =-

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
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++ :pray::pray::pray: , project po namin yan please help para po pumasa :pray::pray::pray:



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 :pray::pray::pray: . tnx po sa tutulong sa akin. :pray::pray::pray:
Gawa ka function for getting the lowest and highest number, isama mo na don yung divisible.

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++
	}
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
 
Last edited:
Re: -= Having Difficulty in C++? Be a Part of This Thread =-


may mga bugs.. pagpress ng "5. Exit" ayaw naman mag-exit tapos yung magtry ulit nagexit bigla.. :lol:

ayaan mo nalang sir..hehe..tulungan nalang natin syang ayusin ang bug :)
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

paano po to.."INCREMENT BY 10 "GIVEN 50" using while loop" lng po....baguhan lang po kasi"..SALAMAT PO!!!


SA TURBO C++ PO YAN...
MERON PO BA KAYONG INSTALLER NG TURBO C++yun po kasi ginagamit namin sa school..salamat po ulit..
 
Last edited:
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

Code:
int given = 0;
while(given != 50)
         given = given + 10;
 
Last edited:
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

Code:
int given = 0;
while(given != 50)
         given = given + 10;

"para san po tong symbol na to "!"
at ano po yung unang ilalagay?
yung cout<<given; po muna o yung given=given +10...salamat po ulit
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

^

setprecision(), setw() search mo na lang yan.

bakit di nadededuct? di naman kasi declared yung tx at sss.. bp lang yung dineclare mo db? bp = hw*550;

try mo gawing printf("Net Pay:%f",bp-(bp*.05)-(bp*0.02));
"para san po tong symbol na to "!"
at ano po yung unang ilalagay?
yung cout<<given; po muna o yung given=given +10...salamat po ulit
"!" means not. Therefore, "!=" means not equal.

Need ba i-display yung 10 20 30 40 pati 50?
Code:
int given = 0;
while(given <= 50)
{
          given = given + 10;
          cout<<given<<endl;
}
 
Last edited:
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

^

setprecision(), setw() search mo na lang yan.

bakit di nadededuct? di naman kasi declared yung tx at sss.. bp lang yung dineclare mo db? bp = hw*550;

try mo gawing printf("Net Pay:%f",bp-(bp*.05)-(bp*0.02));

"!" means not. Therefore, "!=" means not equal.

Need ba i-display yung 10 20 30 40 pati 50?
Code:
int given = 0;
while(given <= 50)
{
          given = given + 10;
          cout<<given<<endl;
}



opo kailangan idisplay yung 10 20 30 40 50....
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

hindi pala "<="... "!=" pala hahaha

visual c++ 2010 nga pala gamit ko.

Code:
int main()
{
	int given = 0;
	while (given != 50)
	{
		given = given + 10;
		cout<<given<<endl;
	}
	return 0;
}
 
Last edited:
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

^

setprecision(), setw() search mo na lang yan.

bakit di nadededuct? di naman kasi declared yung tx at sss.. bp lang yung dineclare mo db? bp = hw*550;

try mo gawing printf("Net Pay:%f",bp-(bp*.05)-(bp*0.02));

ok salamat master!! uu nga pla.else if ba susunod ko kpag nag dagdag ako ng position?....salamat ulit master you make my day:yipee::excited:
tanong ko na din master ano magandang tutorial sa c language?
salamat ulit!!!
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

anong position? yung sa decimal number? hindi na.

sensya na pang <iostream> lang ako eh. di ko maintindihan at ayokong intindihin masyado yung <stdio.h> hahaha
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

anong position? yung sa decimal number? hindi na.

sensya na pang <iostream> lang ako eh. di ko maintindihan at ayokong intindihin masyado yung <stdio.h> hahaha


ahahaha..uu nga kami nlang ata ang gumagamit ng <stdio.h>.ewan ko ba bakit stdio.h pa pnapagamit sa amin.sabagay beginner plang ehehe salamat ulit ha..:salute:
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

hindi pala "<="... "!=" pala hahaha

visual c++ 2010 nga pala gamit ko.

Code:
int main()
{
	int given = 0;
	while (given != 50)
	{
		given = given + 10;
		cout<<given<<endl;
	}
	return 0;
}

ano po dito yung counter? Yung given=given + 10 po ba? Pwede rin po ba ng maging counter yun bukod sa given++ o given--? Salamat po ulit!
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

sir asaman and sir ezroot nga po pala tanong ko lang about dun sa motion detecting software na gagawin namin, may ftp support po ba siya like dorgem?

Tsaka sir medyo naipit po ako kasi nagalit ate ko nung nawala yung files nya sa pc :rofl:

ininstall ko kase yung windows service pack 3, need kasi ng visual studio 2010 yun eh.

papabackup ko na lang muna.
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

patulong po sa project ko..

Convert an integer to string using the following code:
int number = 5; //any integer for example: 5
char s[100]; //an empty array of characters
itoa(number, s, 10); //conversion function. converting number to string s as a decimal (base 10).
string str += string(s); //You can concatenate your converted integer to another string or do whatever you want.

Thank you po.

pa up po.
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

ano po dito yung counter? Yung given=given + 10 po ba? Pwede rin po ba ng maging counter yun bukod sa given++ o given--? Salamat po ulit!

given++ o given--??? equivalent sa given = given + 10??

parang di naman po..kasi..accumulator ang tawag sa given = given + 10.... i think..yung equivalent value nung given = given + 10 ay given += 10 (not sure..kasi "given = given + 10" yang format ang ginagamit namin :lol:)

bale yung unang value ng "given" sa una ay "0"..then every loop..nadagdagan sya ng 10..

 
Last edited:
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

ano po dito yung counter? Yung given=given + 10 po ba? Pwede rin po ba ng maging counter yun bukod sa given++ o given--? Salamat po ulit!
counter for what? sabi mo increment by 10. edi nag-increment ako by 10. :lol:

pero bali parang yung given nga yung counter mo

tama yung nasa taas ko. ang equivalent ng given = given + 10 ay given += 10
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

salamat po!!!:clap:
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

PAtulong po ulit! pano naman po ito pag nalagay ka ng mont day at year ng birthday mo, lalabas yung zodiac sign mo at yung chinese calendar zodiac sign..
parang ganito po
october 28,1992
tapos lalabas yung scorpio at monkey.
Maraming salamat po!!!:help:
 
Re: -= Having Difficulty in C++? Be a Part of This Thread =-

mga tol pa share naman ng code na para sa dalawang number na mg swa swap sya?data types and variables palang kami, yun kse pina pa aral samin wala kse ko idea thanks
 
Back
Top Bottom