Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

BLESSED MUSKWE NC2 C++

// blessed mukwe ict.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int ans,
a,num[10];
float avg =0;
cout<<"Enter 7 numbers"<<endl;
for(a=1;a<=7;a++)
{
cin>>num[a];
avg=(avg+num[a]);
ans=(avg/7);
}
cout<<"The average is : "<<ans;
system ("pause");
return 0;
}
BLESSED MUSKWE NC2 C++

// blessed muskwe remainder.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int quotient,remainder,a,b;
cout<<"Enter first Number"<<endl;
cin>>a;
cout<<"Enter second number"<<endl;
cin>>b;

quotient=a/b;
remainder=a%b;
cout<<"Quotient is :"<<quotient<<endl;
cout<<"Remainder is :"<<remainder<<endl;
system ("pause");
return 0;

You might also like