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 for even numbers?

Answer Posted / kamal

* read a number … */

#include <stdio.h>

int main (void) {

int num; /* input number */

int rem; /* remainder …*/

/* get number from user */

printf(“Please enter a number: ”);

scanf(“%d”, &num);

/* calculate remainder … */

rem = num % 2;

if (rem == 0) {

printf(“even\n”);

} else {

printf(“odd\n”);

}

/* terminate program */

return 0;

}

Is This Answer Correct ?    4 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1

4182


all c language question

2374


What is cohesion in c?

921


What's the best way of making my program efficient?

1037


Explain spaghetti programming?

1188


Explain what is the general form of a c program?

1027


Why do we need arrays in c?

1080


What is strcpy() function?

1084


Can you please compare array with pointer?

1027


Is return a keyword in c?

1028


What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }

2433


Is c language still used?

932


What is malloc return c?

973


What is function prototype in c language?

982


What is c mainly used for?

996