Map

Translate

English French German Spain Italian Dutch

Russian Brazil Japanese Korean Arabic Chinese Simplified
Translate by Google ( UBLO 7 )

visitor

Flag Counter

About Me

PROGRAM MENYATAKAN BILANGAN GENAP DAN GANJIL (C++)

Fungsi strcpy digunakan untuk menyalin isi string ke suatu variabel.

CODE :

#include <stdio.h>
#include <conio.h>
#include <string.h>
main(void)
{clrscr();
    int  number = 1;
    char number1[20] ;
// input
printf("\nMasukan bilangan :  ");scanf("%d", &number);

//proses
while(number<=20){
    if((number!=1)&&(number%2==0))
   {strcpy(number1,"Bilangan tersebut gemap\n");}
   else
   {strcpy(number1,"Bilangan tersebut gamjil\n");}
   number++;getch();break;
          }

//output
printf("\nKeterangan :  %s", &number1);
getch();
      }



HASIL :


0 komentar:

Posting Komentar