Search
 
SCRIPT & CODE EXAMPLE
 

C

programme c qui permet de determiner si M et N sont amis ou non

#include<stdio.h>


main(){
int a, b,sa,sb;

//a=20 ;

printf("donnez le a: ");
scanf("%d",&a);
//b=284;
printf("donnez le b: ");
scanf("%d",&b);
sa=1;
for(int d=2;d<=a-2;d++)
{
    if (a%d==0)
        sa=sa+d;
}
sb=1;
for(int d=2;d<=b-2;d++)
{    if (b%d==0)
        sb=sb+d;
}
if (sb==a && sa==b)
{
    printf("a et b sont amicaux");
}
else printf("a et b ne sont pas amicaux");

}
Comment

PREVIOUS NEXT
Code Example
C :: c stack 
C :: python project script run 
C :: Multi Select with icons htm; 
C :: c disable struct padding 
C :: how many archaeologists are there 
C :: Categorize students according to their marks 
C :: Chef in Vaccination Queue codechef solution in c++ 
C :: how to initiate pointer array with null in c 
C :: C Why enums are used? 
C :: c joystick arduino 
C :: WAP to create Database using array of structure & display it in C 
C :: what to do after autoencoder training 
C :: fgets langage c 
C :: how to make random string in c 
C :: lmkmaksmxkmakkxxamkskaamkamkaxsmkasm 
C :: function declaration in c 
C :: arma 3 nearest terrain objects 
C :: function pointer in c 
C :: c arrays 
C :: c while loop 
Dart :: how to remove debug tag in flutter 
Dart :: flutter statusbar height 
Dart :: add years to date dart 
Dart :: flutter replace character in string 
Dart :: FirebaseOptions cannot be null when creating the default app 
Dart :: textfield height flutter 
Dart :: BoxShadow in DrawerHeader flutter 
Dart :: flutter url image 
Dart :: flutter linearprogressindicator value 
Dart :: flutter icon tap 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =