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...

what is the other ways to find a logic to print whether a
number is an even or odd wit out using % symbol??????? i
know three different ways to print it. so i need any other
different logic>>>>>

Answer Posted / tirtharaj dash@nist

#include<stdio.h>
#include<conio.h>

int main()
{
int a,b,r,i;
scanf("%d",&b);
int temp=b;
for(i=1;i<=b/2;i++)
{
r=temp-2*i;
}
if(r==0)
printf("\neven...");
else
printf("\nodd");

getch();
return 0;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is fortran faster than c?

1046


What is a structure member in c?

1007


What is the symbol indicated the c-preprocessor?

1251


What is structure in c language?

1174


Explain data types & how many data types supported by c?

1085


What is a structure in c language. how to initialise a structure in c?

1067


What is a void pointer in c?

1110


How would you use the functions fseek(), freed(), fwrite() and ftell()?

1166


Can you write the function prototype, definition and mention the other requirements.

1137


How can I change their mode to binary?

1119


What is the difference between int main and void main?

1051


what will be the output for the following main() { printf("hi" "hello"); }

11009


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2646


What is the difference between abs() and fabs() functions?

1129


Tell me can the size of an array be declared at runtime?

1046