1. Write a C program to print a Series of Integer Numbers,which is divisible by 3 from a given set of limits.
Sample Input:
Start_value: 1
End_value: 10
Sample Output:
3, 6, 9
2. Write a C program to print a Series of Odd Numbers and Even Numbers. After Print Make an Average of all Printed Odd Numbers and Even Numbers.
Sample Output:
The Even Numbers are: 2, 4, 6, 8, 10
The Odd Numbers are: 1, 3, 5, 7, 9
The Average of Even Numbers: 6
1.
main()
{
int start, end, i ;
printf("Start_Value: ");
scanf("%d", &start);
printf("End_Value: ");
scanf("%d", &end);
printf("\n\n");
for(i=start ; i <= end ; i++)
{
if(i%3 = = 0)
printf("%d, ", i );
}
getch();
return 0;
}
2.
main()
{
int i,sumeven=0, sumodd=0, even=0, odd=0;
float aveeven, aveodd;
printf("The Even Numbers are: ");
for(i=1;i<=15;i++)
{
if(i%2==0)
{
printf("%d, ",i);
sumeven+=i;
even++;
}
}
printf("\n\nThe Odd Numbers are: ");
for(i=1;i<=15;i++)
{
if(i%2!=0)
{
printf("%d, ",i);
sumodd+=i;
odd++;
}
}
aveeven=(float)(sumeven)/even;
aveodd=(float)(sumodd)/odd;
printf("\n\nThe Average of Even Numbers: %.2f", aveeven);
printf("\n\nThe Average of Odd Numbers: %.2f", aveodd);
getch();
return 0;
}
<< Go to Index Page >>
1.
উত্তরমুছুন#include
main()
{
int start, end, I;
printf("Start_Value: ");
scanf("%d", &start);
printf("End_Value: ");
scanf("%d", &end);
printf("\n\n");
for(I=start;I<=end;I++)
{
if(I%3==0)
printf("%d, ", I);
}
getch();
return 0;
}
#include
উত্তরমুছুনmain()
{
int i,sumeven=0, sumodd=0, even=0, odd=0;
float aveeven, aveodd;
printf("The Even Numbers are: ");
for(i=1;i<=15;i++)
{
if(i%2==0)
{
printf("%d, ",i);
sumeven+=i;
even++;
}
}
printf("\n\nThe Odd Numbers are: ");
for(i=1;i<=15;i++)
{
if(i%2!=0)
{
printf("%d, ",i);
sumodd+=i;
odd++;
}
}
aveeven=(float)(sumeven)/even;
aveodd=(float)(sumodd)/odd;
printf("\n\nThe Average of Even Numbers: %.2f", aveeven);
printf("\n\nThe Average of Odd Numbers: %.2f", aveodd);
getch();
return 0;
}
#include
উত্তরমুছুন#include
main() //it's a programe to find Even number
{
int n=0;
while (n<10)
{
n=n+1;
if (n%2==1)
{
continue;
}
printf("%d\n",n);
}
return 0;
}
#include
উত্তরমুছুন#include
main() //it's a programe to find odd number
{
int n=0;
while (n<10)
{
n=n+1;
if (n%2==0)
{
continue;
}
printf("%d\n",n);
}
return 0;
}
// Write a C program to print a Series of Integer Numbers,which is divisible by 3 from a given set of limits //
উত্তরমুছুন#include
int main()
{
int a,b,c;
printf("\nEnter the limit: ");
scanf("%d",&b);
printf("\nEnter the numbers: ");
scanf("%d",&c);
printf("\nThe numbers divisible by %d are: \n\n",c);
for(a=1;a<=b;a++)
if(a%c==0)
printf("%d\t",a);
}
#includ
উত্তরমুছুনmain()
{
int run , stop, i ;
printf("run_Value: ");
scanf("%d", &run);
printf("stop_Value: ");
scanf("%d", &stop);
printf("\n\n");
for(i=run ; i <= stop ; i++)
{
if(i%3 = = 0)
printf("%d, ", i );
}
getch();
return 0;
}
id:201330499
উত্তরমুছুন1.
#include
using namespace std;
class base
{
public:
int start,endd,i;
int get_inp()
{
cout<<"1st value is: ";
cin>>start;
cout<<"last value is : ";
cin>>endd;
x=start;
y=endd;
}
protected:
int x,y;
};
class derive:public base
{
public:
int devisible_by_3()
{
for(i=start;i<=endd;i++)
{
if(i%3==0)
cout<<i<<" ";
}
}
};
int main()
{
derive d;
d.get_inp();
d.devisible_by_3();
return 0;
}
id:201330499
উত্তরমুছুন2...
#include
using namespace std;
class base
{
public:
int get_inp()
{
int start,endd;
cout<<"1st value is: ";
cin>>start;
cout<<"last value is : ";
cin>>endd;
x=start;
y=endd;
}
protected:
int x,y;
};
class derive:public base
{
public:
int i,evensum=0,oddsum=0,even=0,odd=0;
float evenavg, oddavg;
int odd_even()
{
cout<<"The Even Numbers are: ";
for(i=x;i<=y;i++)
{
if(i%2==0)
{
cout<<i<<" "<<endl;
evensum+=i;
even++;
}
}
cout<<"The Odd Numbers are: ";
for(i=1;i<=15;i++)
{
if(i%2!=0)
{
cout<<i<<" "<<endl;
oddsum+=i;
odd++;
}
}
evenavg=(float)(evensum)/even;
oddavg=(float)(oddsum)/odd;
cout<<"The Average of Even Numbers:"<<evenavg<<endl;
cout<<"The Average of Odd Numbers:"<<oddavg<<endl;
}
};
int main()
{
derive d;
d.get_inp();
d.odd_even();
return 0;
}
Summer 2017
উত্তরমুছুনID#201610042
Answer to Question 10:
problem 1: https://drive.google.com/file/d/0B99eePh0LV8gdW91VzQzU2t6cms/view?usp=drivesdk
problem 2: https://drive.google.com/file/d/0B99eePh0LV8gVS1JN1N1YURjbmM/view?usp=drivesdk
ID : 201620195
উত্তরমুছুন1) https://drive.google.com/open?id=0B9K31ospCyFjbmhrQklsbWpranM
2) https://drive.google.com/open?id=0B9K31ospCyFjLUp1ZzE0MHRfbGc
https://drive.google.com/open?id=0BzTqZMBWR6eORGhqRGtXWG9MbGs
উত্তরমুছুনhttps://drive.google.com/open?id=0BzTqZMBWR6eONGRYQ1FLYzZRSk0
উত্তরমুছুন1.https://drive.google.com/open?id=0B8369pAqjVVpOUZhTUpRS18zVTA
উত্তরমুছুন1. with p. https://drive.google.com/open?id=0B8369pAqjVVpaDVSaXVEVS1HVzQ
উত্তরমুছুনID 201610456
উত্তরমুছুনMD USUF MIA
https://drive.google.com/open?id=0B_PIGnOMR0K2a3hHZzNwOXQtZWM
ID:201520552
উত্তরমুছুনhttps://drive.google.com/open?id=0B5pG0kIjzgEKU1VVbzhORk16TG8
ID:201520552
উত্তরমুছুনhttps://drive.google.com/open?id=0B5pG0kIjzgEKZlZzTnF2VWRqaDA
1.https://drive.google.com/open?id=0B7UQyRdu6h2wTGhKemVJRnpFOEU
উত্তরমুছুনhttps://drive.google.com/open?id=0Byxq3aat_mNSRzhReG1rZHhzT0E
উত্তরমুছুনhttps://drive.google.com/open?id=0BzKpnVbF4fc3NG1ValNVb3FMUFU
উত্তরমুছুনid:201710933
উত্তরমুছুনhttps://drive.google.com/open?id=0B0bbxKUPFizZaXhPOGNrMlBxSFk
https://drive.google.com/open?id=0B3bVD5Ppt_STdlRxeG5EZ1YtS3c
উত্তরমুছুনhttps://drive.google.com/open?id=0B3bVD5Ppt_STSHFvWG4xcks3UFE
উত্তরমুছুনhttps://drive.google.com/open?id=0BxajN_bZJJw0dFVQMy1Obmc1R1U
উত্তরমুছুনhttps://drive.google.com/open?id=0B97tDB8iESNCd1p0c3d1bmMzWEU
উত্তরমুছুনhttps://drive.google.com/open?id=0B8uArqPAKtGrQl9VWXNTbHpfd0E
উত্তরমুছুনName: Bithi Paul, ID:201631161
উত্তরমুছুন1. https://drive.google.com/open?id=0B5eevQy6QwSOdm5uVmwzdzhnMXc
2. https://drive.google.com/open?id=0B5eevQy6QwSOYWtBYUJjMFBQMVE
ID:-201610058
উত্তরমুছুন1.https://drive.google.com/open?id=0B7UQyRdu6h2wTGhKemVJRnpFOEU