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 code for 3 questions and answer check in VisualBasic.Net?

2101


what is recursion in C

1019


Explain high-order and low-order bytes.

1049


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

3019


I heard that you have to include stdio.h before calling printf. Why?

1007


If errno contains a nonzero number, is there an error?

1292


What is a macro?

1051


Is using exit() the same as using return?

1250


which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

1672


Explain pointer. What are function pointers in C?

1016


What are predefined functions in c?

1022


What is a function in c?

1485


What is the purpose of macro in C language?

1064


What is the translation phases used in c language?

1060


What happens if header file is included twice?

1090