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

Answer Posted / viral

#include<conio.h>
#include<stdio.h>
void main()
{
int a;
clrscr();

printf("enter the number ");
scanf("%d",&a);

if(a%3==0)
printf("the number %d is divisble by 3",a);
else
printf("the number %d is not divisible by 3",a);
getch();
}

Is This Answer Correct ?    20 Yes 48 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

646


What is an arrays?

656


When should you use a type cast?

593


How to explain the final year project as a fresher please answer with sample project

472


How to draw the flowchart for structure programs?

8762






What is the function of multilevel pointer in c?

672


Is it possible to pass an entire structure to functions?

563


Can you write a programmer for FACTORIAL using recursion?

614


What is main return c?

519


What type is sizeof?

587


Is fortran faster than c?

585


What is #line used for?

583


Tell me what are bitwise shift operators?

659


What is union and structure?

575


How many header files are in c?

554