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

Write a program to print “hello world” without using semicolon?

1077


Differentiate fundamental data types and derived data types in C.

984


What is the 'named constructor idiom'?

1032


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2703


What is null pointer in c?

948


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

3129


Explain the use of 'auto' keyword in c programming?

1071


Why is c so popular?

1118


Where are the auto variables stored?

1090


What are the application of void data type in c?

1133


Can you tell me how to check whether a linked list is circular?

1325


What is the stack in c?

1082


List some applications of c programming language?

901


Why #include is used in c language?

994


What does static variable mean in c?

1060