Click here to Skip to main content
15,903,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Visual C++ and C programming Pin
David Crow18-Jan-06 9:16
David Crow18-Jan-06 9:16 
GeneralRe: Visual C++ and C programming Pin
thierrypp18-Jan-06 9:25
thierrypp18-Jan-06 9:25 
GeneralRe: Visual C++ and C programming Pin
David Crow18-Jan-06 9:58
David Crow18-Jan-06 9:58 
GeneralRe: Visual C++ and C programming Pin
thierrypp18-Jan-06 10:07
thierrypp18-Jan-06 10:07 
GeneralRe: Visual C++ and C programming Pin
BadKarma18-Jan-06 10:35
BadKarma18-Jan-06 10:35 
GeneralRe: Visual C++ and C programming Pin
thierrypp18-Jan-06 10:42
thierrypp18-Jan-06 10:42 
GeneralRe: Visual C++ and C programming Pin
Graham Bradshaw18-Jan-06 9:10
Graham Bradshaw18-Jan-06 9:10 
GeneralRe: Visual C++ and C programming Pin
thierrypp18-Jan-06 9:16
thierrypp18-Jan-06 9:16 
yes, files with a c extension *.c

for example: and result of compilation..
for example:

/* ---------- */
/* premier2.c */
/* ---------- */
#include
#include

main()
{
int nb, diviseur1, diviseur2,reste ;
int trouve,i ,racinecar,limite ;
int nb_iterations=1;

printf("Entrez un Nombre :");
scanf("%d",&nb);

/* partie entiere de la racine carre+1 */
limite=sqrt(nb)+1;
trouve=0 ;

if (nb != 2) /* 2 est premier */
{
/* on retire le cas des nombres pairs */
reste=nb%2 ;
if (reste == 0)
{
trouve=1 ;
/* on memorise les diviseurs */
diviseur1=2 ;
diviseur2=nb/2 ;
}
else
{
/* teste tous les diviseurs impairs */
i=3;
while ( (! trouve) && (i<=limite) )
{
nb_iterations++;

reste= nb%i ;
if (reste == 0)
{
trouve=1 ;
/* on memorise les diviseurs */
diviseur1=i ;
diviseur2=nb/i ;
}
i+=2 ;
}
}
}

if (trouve)
{
printf("%d n'est pas premier !\n",nb);
printf("il est divisible par %d et %d\n",diviseur1,diviseur2);
}
else
{
printf("%d est un nombre PREMIER !\n",nb);
}
printf("RŽsultat obtenu en %d itŽrations\n",nb_iterations);
}

result:
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/premier2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

premier2.exe - 2 error(s), 0 warning(s)
GeneralRe: Visual C++ and C programming Pin
BadKarma18-Jan-06 9:54
BadKarma18-Jan-06 9:54 
GeneralRe: Visual C++ and C programming Pin
thierrypp18-Jan-06 9:58
thierrypp18-Jan-06 9:58 
GeneralRe: Visual C++ and C programming Pin
BadKarma18-Jan-06 10:07
BadKarma18-Jan-06 10:07 
GeneralRe: Visual C++ and C programming Pin
thierrypp18-Jan-06 10:20
thierrypp18-Jan-06 10:20 
GeneralRe: Visual C++ and C programming Pin
David Crow18-Jan-06 10:04
David Crow18-Jan-06 10:04 
GeneralRe: Visual C++ and C programming Pin
BadKarma18-Jan-06 10:17
BadKarma18-Jan-06 10:17 
GeneralRe: Visual C++ and C programming Pin
Graham Bradshaw18-Jan-06 12:15
Graham Bradshaw18-Jan-06 12:15 
GeneralRe: Visual C++ and C programming Pin
thierrypp18-Jan-06 12:34
thierrypp18-Jan-06 12:34 
GeneralRe: Visual C++ and C programming Pin
thierrypp18-Jan-06 12:43
thierrypp18-Jan-06 12:43 
GeneralRe: Visual C++ and C programming Pin
thierrypp18-Jan-06 9:48
thierrypp18-Jan-06 9:48 
AnswerRe: Visual C++ and C programming Pin
Rage19-Jan-06 0:04
professionalRage19-Jan-06 0:04 
GeneralRe: Visual C++ and C programming Pin
thierrypp19-Jan-06 3:44
thierrypp19-Jan-06 3:44 
GeneralRe: Visual C++ and C programming Pin
Shraddhan22-Jan-06 19:22
Shraddhan22-Jan-06 19:22 
GeneralRe: Visual C++ and C programming Pin
Shraddhan22-Jan-06 19:28
Shraddhan22-Jan-06 19:28 
QuestionMFC GUI Pin
greendays_0118-Jan-06 7:36
greendays_0118-Jan-06 7:36 
AnswerRe: MFC GUI Pin
paragdoshi18-Jan-06 7:52
paragdoshi18-Jan-06 7:52 
AnswerRe: MFC GUI Pin
FarPointer18-Jan-06 8:01
FarPointer18-Jan-06 8:01 

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.