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
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 ].
What is an arrays?
When should you use a type cast?
How to explain the final year project as a fresher please answer with sample project
How to draw the flowchart for structure programs?
What is the function of multilevel pointer in c?
Is it possible to pass an entire structure to functions?
Can you write a programmer for FACTORIAL using recursion?
What is main return c?
What type is sizeof?
Is fortran faster than c?
What is #line used for?
Tell me what are bitwise shift operators?
What is union and structure?
How many header files are in c?