WAP to Find the Number of Integers Divisible by 5 between Given Range of Values by using for Statement

Number divisible by 5

Statement of C Program: WAP(Write a Program) to Find the Number of Integer Divisible by 5 between the given range N1 and N2 , where N1<N2 and are Integers. Also Find the Sum of all these Integer Numbers that are Divisible by 5.

#include<stdio.h>
#include<conio.h>
main()
{
int i , N1 , N2 , count = 0 , sum = 0;
clrscr();
printf(" Enter the values of N1 and N2\n");
scanf("%d%d" , &N1 , &N2);
printf(" Integers divisible by 5 are\n");

for( i=N1 ; i<=N2 ; i++)
{
if((i%5) == 0)
{
printf("%d" , i)
count ++;
sum = sum +i;
}
}
printf("\n Number of integers divisible by 5 between %d and %d = %d\n" , N1 , N2 , count);
printf(" Sum of all integer divisible by 5 = %d\n" , sum);
getch();
}                                  /* End of main() */

Output:
Enter the value of N1 and N2
2
27
Integer divisible by 5 are
5 , 10 , 15 , 20 , 25
Number of integers divisible by 5 between 2 and 27 = 5
sum of integer that are divisible by 5 = 75

                                                               That's All

0 Response to "WAP to Find the Number of Integers Divisible by 5 between Given Range of Values by using for Statement"

Post a Comment

Popular Posts

Label

1 Sidebar 2 Columns 3 Columns Footer 3rdball 4 Columns Footer Alex Alvaro Antsasia Arlinadesign Averie Barry BASIC CONCEPTS Basil Bayna Fast BeautyPress BeautyTemplates Beckel Best Best - Clean Beyonce Pro BioMag BlackMag Blanter Nova Blogger Card Bloggertheme9 Blogish Bpress Brakt C LANGUAGE C PROGRAMS C++ LANGUAGE C++ PROGRAMS Carella Cellar Charlotte Chooko Lite Clara Clean Combo One Cooperate Crusade Darry Dorman Dreamway Dunia Blanter eCars EduAcademy EducationPress Elise Elvan Eva Everyday FabNews Fashion Fashion Blogger Template Fashion Gossip FastCars Fedo FlashNews Fredy Portfolio Gaming Globus GoodTime Goomsite HTML LANGUAGE iGaming Indicate Innove Insomnia InspiredNews iSoft Jasmine Kalem Landscaping Lashira Lavelle Lily Fashion Limax Linea Lionex Luminescence Lite Lumix Luxury Magazine MagazinePro MAJOR DIFFERENCES MarketingBlog Martin MaxiMag Medica Mega Melissa Mercury MeshMag Minimag Minimalist MiniNews MovieKhor msdesignbd MusicLand Neko NetZine New Spread News16 Newsflash NewsForce NewsIdea Newspaper News NewsPro Nubie Fast Odd Themes Optima PaperMag PaperMag blog Parhlo Perfection Personal Personal Blog Photosout PixelZ Power Blog Premium Themes ProfileMag Purez Rano ReadNews Real estate Remito Grid Responsive Revo Robusta Rotario Saara SeoBoost Settle Shouters Simple Catch SimpleClean Sketchly SNews SolidMag Someo Sophie Sora Sora Bank Sora Home Sora News Responsive Sora One Sora Ribbon Spido Sticko Stucco Sure Mag Swift Tech Tech Pro Techia Techmax TechSpot TemplateClue Templateism Templatesilk Templatesyard Templatezy The Freelancer TheBlogger TheFocus Themeforest Themexpose TIPS AND TRICKS Topside TravelMag Trendy Trendy Travel Tumblr Under Construction Uong Jowo Veethemes Vertox VideoPlay Vigo Waverly way2themes WebBiz Wedding X-Mag Zealer ZetaMag