Click here to Skip to main content
15,912,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get the password in IAS extension dll if ms-chap is used by radius client? Pin
okmnji7951315-Feb-09 18:56
okmnji7951315-Feb-09 18:56 
GeneralRe: How to get the password in IAS extension dll if ms-chap is used by radius client? Pin
okmnji7951316-Feb-09 22:31
okmnji7951316-Feb-09 22:31 
GeneralRe: How to get the password in IAS extension dll if ms-chap is used by radius client? Pin
okmnji7951317-Feb-09 20:01
okmnji7951317-Feb-09 20:01 
Questiontrie Pin
tmnnik11-Feb-09 10:57
tmnnik11-Feb-09 10:57 
AnswerRe: trie Pin
Stuart Dootson11-Feb-09 11:12
professionalStuart Dootson11-Feb-09 11:12 
QuestionRe: trie Pin
led mike11-Feb-09 11:26
led mike11-Feb-09 11:26 
AnswerRe: trie Pin
Stuart Dootson11-Feb-09 12:15
professionalStuart Dootson11-Feb-09 12:15 
Questionc program that inputs 5 pairs of integers and determine if the second one is multiple of the first one Pin
raeiko11-Feb-09 10:42
raeiko11-Feb-09 10:42 
Hello everybody,

i need some help with my code. The program seems to work,the problem is that it only outputs the result for the last pair of numbers and repeat it for 5 times.

Could you please help me to understand what i'm doing wrong?

Thanks a lot,

raeiko

<br />
/* Program that reads a pair of numbers and determines whether the second number is multiple of the first one */<br />
<br />
#include <stdio.h><br />
<br />
int multiple ( int j, int z); /* function prototype */<br />
<br />
int main( void )    /* function main begins program execution */<br />
{<br />
    int num1, num2, x, i; /* declare variables */<br />
	<br />
	for ( x = 1; x <= 5; x++ ){	<br />
		printf( "Enter the first number:" ); /* prompt for input */<br />
		scanf_s("%d", &num1 ); /* read number from user */<br />
<br />
		if ( num1 != 0){<br />
			printf( "Enter the second number:" ); /* prompt for input */<br />
			scanf_s("%d", &num2 ); /* read number from user */<br />
			} <br />
		else {<br />
			break;<br />
			printf( "\nBroke from loop because num1 must be greater than 0\n" ); /* break loop if num1 == 0 */<br />
			}<br />
		}<br />
<br />
<br />
	 multiple( num1, num2);<br />
	<br />
<br />
return 0;<br />
}<br />
<br />
int multiple ( int j, int z ) /* copy of the argment to function */<br />
{	<br />
		int y; /* counter */<br />
		<br />
		int result;<br />
<br />
		result = z % j;<br />
		<br />
	for ( y = 1; y <= 5; y++ ) <br />
		if( result == 0){<br />
		printf( "%d is multiple of %d\n", z, j );<br />
		}<br />
	else {<br />
		printf( "%d is not multiple of %d\n", z, j );<br />
		}<br />
<br />
	return result;<br />
} /* end of multiple function */

AnswerRe: c program that inputs 5 pairs of integers and determine if the second one is multiple of the first one Pin
Stuart Dootson11-Feb-09 11:07
professionalStuart Dootson11-Feb-09 11:07 
GeneralRe: c program that inputs 5 pairs of integers and determine if the second one is multiple of the first one Pin
raeiko11-Feb-09 11:31
raeiko11-Feb-09 11:31 
GeneralRe: c program that inputs 5 pairs of integers and determine if the second one is multiple of the first one Pin
Stuart Dootson11-Feb-09 12:30
professionalStuart Dootson11-Feb-09 12:30 
GeneralRe: c program that inputs 5 pairs of integers and determine if the second one is multiple of the first one Pin
raeiko11-Feb-09 13:28
raeiko11-Feb-09 13:28 
AnswerRe: c program that inputs 5 pairs of integers and determine if the second one is multiple of the first one Pin
CPallini11-Feb-09 11:59
mveCPallini11-Feb-09 11:59 
QuestionRe: c program that inputs 5 pairs of integers and determine if the second one is multiple of the first one Pin
David Crow12-Feb-09 3:24
David Crow12-Feb-09 3:24 
QuestionTrying to load a wave file into a class from the resource's Pin
simon alec smith11-Feb-09 10:05
simon alec smith11-Feb-09 10:05 
AnswerRe: Trying to load a wave file into a class from the resource's Pin
Stuart Dootson11-Feb-09 11:05
professionalStuart Dootson11-Feb-09 11:05 
QuestionA quick question about Microsoft Visual C++ Runtimes and Visual Studio 2008. Pin
santiageitorx11-Feb-09 7:21
santiageitorx11-Feb-09 7:21 
AnswerRe: A quick question about Microsoft Visual C++ Runtimes and Visual Studio 2008. Pin
led mike11-Feb-09 7:44
led mike11-Feb-09 7:44 
AnswerRe: A quick question about Microsoft Visual C++ Runtimes and Visual Studio 2008. Pin
Stuart Dootson11-Feb-09 7:52
professionalStuart Dootson11-Feb-09 7:52 
GeneralRe: A quick question about Microsoft Visual C++ Runtimes and Visual Studio 2008. Pin
led mike11-Feb-09 8:25
led mike11-Feb-09 8:25 
JokeRe: A quick question about Microsoft Visual C++ Runtimes and Visual Studio 2008. Pin
Perspx11-Feb-09 8:39
Perspx11-Feb-09 8:39 
GeneralRe: A quick question about Microsoft Visual C++ Runtimes and Visual Studio 2008. Pin
Stuart Dootson11-Feb-09 8:56
professionalStuart Dootson11-Feb-09 8:56 
GeneralRe: A quick question about Microsoft Visual C++ Runtimes and Visual Studio 2008. Pin
santiageitorx11-Feb-09 8:04
santiageitorx11-Feb-09 8:04 
GeneralRe: A quick question about Microsoft Visual C++ Runtimes and Visual Studio 2008. Pin
Stuart Dootson11-Feb-09 9:07
professionalStuart Dootson11-Feb-09 9:07 
QuestionHow to manage image position after changing screen resolution? Pin
Supra211-Feb-09 7:03
Supra211-Feb-09 7:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.