What's new

Help Octal Number System in C

-useR_name-

Forum Veteran
Elite
Joined
Sep 29, 2016
Posts
1,588
Solutions
6
Reaction
1,480
Points
644
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
 
Last edited by a moderator:
[XX='-useR_name-, c: 970118, m: 641630'][/XX] try mo nga yung edited code ko lods if working ba, wala kasi ako compiler, utak ko ginawa ko lang compiler eh hahaha,
 
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);
}
 
[XX='-useR_name-, c: 970324, m: 641630'][/XX]
walang anuman sorry mali code ko nung una, kasi akala ko hanggang 10 lang, sobra pa pala, so lumevel up ako ng konti :)
 

Similar threads

Back
Top