Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program to find a given no. is divisible by 3 or not
without using any arthimetic operators?

Answer Posted / siva prabhu

#include<stdio.h>

int main()
{
int x,y,i=0,j=0,r=0;
printf("enter a num\n");
scanf("%d",&x);

if(x>3)
{
while(x>0)
{
i=0;
while(i<3)
{
--x;
++i;
}
++j;
if(x<3)
{
r=x;
printf("reminder is %d\n",x);
break;
}
}
if(r==0)
printf("the given is divisible by 3\n");
else
printf("the given no. is not %% by %3\n");
}
else
{
printf("the given no. is not %% by %3\n");
}
return 0;
}

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the symbol indicated the c-preprocessor?

1184


What is structure packing in c?

1039


Do pointers store the address of value or the actual value of a variable?

1039


What is the difference between fread buffer() and fwrite buffer()?

1130


Write a program to check palindrome number in c programming?

981


What is the best style for code layout in c?

1068


What is the difference between Printf(..) and sprint(...) ?

1459


What are the key features in c programming language?

1026


Is struct oop?

973


How macro execution is faster than function ?

1149


Do you have any idea about the use of "auto" keyword?

1059


What is the difference between printf and scanf in c?

1305


Why main function is special give two reasons?

1506


What is the time and space complexities of merge sort and when is it preferred over quick sort?

1031


How do I get an accurate error status return from system on ms-dos?

1088