Believe it or not Draw Your Own Mind..........
Home
Software
Easy Notes
Ebooks
Poetry
Contact Us
Python 2.7.3
Microsoft Visual C++
Avast Antivirus with keys
PC File Recovery
Hotspot Shield
USB Disk Security
Corel Draw X6
Adobe Photoshop CS6
Cinema4d r13+keys
C++ Codes
Python Codes
C++ Videos
C++ Slideshows
Intro to Computing Notes
Intro to Computing Slides
1st Semester Books
Hadith Books
Ayoubi Ki Yalgharain
Friday, 16 November 2012
Average of Numbers divisible by 3 between 1 and 100
#include <iostream>
using namespace std;
int main()
{
double avg,sum=0,counter=0;
for(int j=1;j<=100;j++)
{
if(j%3==0)
{
counter++;
sum=sum+j;
}
}
avg=sum/counter;
cout << "The Average is = "<<avg<<endl;
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment