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

WAP that prints the number from 1 to 100. but for multiplies of
three print "XXX" instead of the number and for the multiplies of
five print "YYY" . for number which are multiplies of both three
and five print "ZZZ"

Answer Posted / vadivel t

#include<stdio.h>

main()
{
int i;
for(i = 1 ; i<=100; i++)
{
if((i%5 == 0) && (i%3 == 0))
printf("ZZZ \n");

else if(i%3 == 0)
printf("XXX \n");

else if(i%5 == 0)
printf("YYY \n");

else
printf("%d \n",i);
}
_getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of functions in c?

986


find out largest elemant of diagonalmatrix

2249


what are the different storage classes in c?

1179


What is c language used for?

982


What does *p++ do? What does it point to?

1065


What is the best way of making my program efficient?

1031


Explain about the constants which help in debugging?

1379


What is the difference between procedural and declarative language?

1143


Write the control statements in C language

1208


What is wrong in this statement?

1145


A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

2316


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

2369


What are the different file extensions involved when programming in C?

1268


Using which language Test cases are added in .ptu file of RTRT unit testing???

4280


Differentiate fundamental data types and derived data types in C.

1034