🔒 Closed Octal Number System in C

Status
Not open for further replies.

-useR_name-

Forum Veteran
Hi magandang araw, pwede po ba maka hingi ng codes nyo about Octal number system

Yung output po sana 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20.


Maraming salamat po
 
Sinubukan ko sir ayaw mag terminate nang 8 at 9
Edit : na terminate ko na po yung 8 at 9 pero ayaw sumama ng 18 at 19 kahit same character sila
 
FreeAllYouCan-OFFICIAL
Ito po code ko
[CODE lang="c" title="Even and Octal numbers"]#include <stdio.h>

int main()
{
int a,i;
scanf("%d",&a);
printf ("Even numbers: ");
for(i=1;i<=a;i++)
{
if(i%2==0)
{
printf ("%d\t",i);
}
}
printf ("\nOctal numbers: ");
for(i=0;i<=a;i++)
{
if(i!=8)
if(i!=9)
if(i!=18)
if(i!=19)
if(i!=28)
if(i!=29)
{
printf ("%d\t",i);
}
}
return 0;
}[/CODE]

Pwede na po ba? Open for changes po as long mag grow progress ko hehe
 
[XX='FreeAllYouCan-OFFICIAL, c: 970302, m: 737730'][/XX] boss iniba ko nang kunti yung code mo, at gumana po sobrang salamat po boss


int i;
int oct1 = 8, oct2 = 9;
for(i = 0; i <= 100; i++)
{
if(i == oct1)
oct1 += 10;
else if(i == oct2)
oct2 += 10;
else
printf("%d\t",i);
}
 
Status
Not open for further replies.

Similar threads

About this Thread

  • 14
    Replies
  • 365
    Views
  • 2
    Participants
Last reply from:
FreeAllYouCan-OFFICIAL

Online now

Members online
1,092
Guests online
920
Total visitors
2,012

Forum statistics

Threads
2,277,028
Posts
28,973,795
Members
1,229,690
Latest member
ravendc1107
Back
Top