SlideShare a Scribd company logo
1 of 27
Download to read offline
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
পঞ্চম অধ্যায়ে স঴ প্রাগ্রাম- সিছু গুরুত্বপূর্ণ ঴ম঴যা ঴মাধ্ান
==============================================================================================
১. ICT PRIVATE program প্঱খা ছাপায়নার জনয স঴ ভা঳াে প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main()
{
printf("ICT PRIVATE PROGRAM");
getch();
}
২. সিয়বার্ণ প্েয়ি দুইসি ঴ংখযা ইনপুি সনয়ে প্যাগ িরার এিসি প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main()
{
int a, b, sum;
printf(" Type the first number: ");
scanf("%d",&a);
printf("Type the second number:");
scanf("%d",&b);
sum = a+b;
printf("Summation = %d",sum);
getch();
}
https://icttutorialforall.blogspot.com
৩. সিয়বার্ণ প্েয়ি দুইসি ঴ংখযা ইনপুি সনয়ে সবয়োগ িরার প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main()
{
int a, b, sub;
printf(" Type the first number: ");
scanf("%d",&a);
printf("Type the second number: ");
scanf("%d",&b);
sub = a-b;
printf("Subtraction= %d",sub);
getch();
}
1
st
update: 03-08-2016
2
nd
update: 07-04-2017
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
৪. সিয়বার্ণ প্েয়ি দুইসি ঴ংখযা ইনপুি সনয়ে গুন িরার স঴ ভা঳াে প্রাগ্রাম।
#include<stdio.h>
#include<conio.h>
main()
{
int a, b, mul;
printf(" Type the first number: ");
scanf("%d",&a);
printf(" Type the second number: ");
scanf("%d",&b);
mul = a*b;
printf("Multiplication= %d", mul);
getch();
}
https://icttutorialforall.blogspot.com
৫. সিয়বার্ণ প্েয়ি দুইসি ঴ংখযা ইনপুি সনয়ে ভাগ িরার স঴ ভা঳াে প্রাগ্রাম।
#include<stdio.h>
#include<conio.h>
main()
{
int a, b;
float div;
printf("Type the first number: ");
scanf("%d",&a);
printf("Type the second number: ");
scanf("%d",&b);
div = a/b;
printf("Division= %f",div);
getch();
}
৬. প্঴঱স঴ো঴ প্েয়ি ফারয়ন঵াইি প্বর িরার জনয স঴ ভা঳াে প্রাগ্রাম।
#include<stdio.h>
#include<conio.h>
main()
{
int c;
float fer;
printf("Enter celcious temperature :");
scanf("%d",&c);
f=9*c/5+32;
printf("Ferhenheight temperature:%f”,fer);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
৭. ফারয়ন঵াইি প্েয়ি প্঴঱স঴ো঴ প্বর িরার জনয স঴ ভা঳াে প্রাগ্রাম।
#include<stdio.h>
#include<conio.h>
main()
{
int fer;
float c;
printf("Enter Ferenheight temperature :");
scanf("%d",&fer);
c=5*(f-32)/9;
printf("Celcious temperature:%f”,c);
getch();
}
৮. সিভু য়জর প্েিফ঱ সনর্ণে িরার জনয স঴ ভা঳াে এিসি প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main()
{
int b,h;
float area;
printf("Enter the Base:");
scanf("%d",&b);
printf("Enter the Height:");
scanf("%d", &h);
area=.5*b*h;
printf("nThe area is %.2f",area);
getch();
}
https://icttutorialforall.blogspot.com
৯. ২ প্েয়ি ১০০ পযণন্ত ঴ংখযাগুয়঱া প্যাগ িরার স঴ প্রাগ্রাম।
#include<stdio.h>
#include<conio.h>
int main()
{
int i, sum;
sum=0;
for(i=2; i<=100; i+=2)
{
sum=sum+i;
}
printf("sum %d", sum);
return 0;
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
১০. ওোন র্াইয়মনলনা঱ অযায়র ৫সি ঴ংখযা ইনপুি সনয়ে তা for loop এর মাধ্যয়ম প্দখাও।
#include<stdio.h>
#include<stdio.h>
main()
{
int i;
int marks[5]={20, 25, 30, 17, 14};
printf("one dimension array Elements in 5n");
for(i = 0; i<5; i++){
printf("%d n", marks[i]);
}
getch();
}
https://icttutorialforall.blogspot.com
১১. a প্েয়ি z পযণন্ত অের গুয়঱া প্দখায়না জনয স঴ ভা঳াে প্রাগ্রাম স঱খ।
// litter A to Z show screen
#include<stdio.h>
#include<stdio.h>
main()
{
char alphabet = 'a';
do
printf("%c n", alphabet++);
while(alphabet<='z');
getch();
}
১২. ১+৩+৯+২৭+................................+n িংখ্যক ঩মযন্ত প্মোগপর বনর্ যয় কযোময় বি প্রোগ্রোভ।
#include<stdio.h>
#include<conio.h>
#include<math.h>
main(){
int i,n,result;
result = 0;
printf("Enter the nth value:");
scanf("%d",&n);
for(i = 0; i < n; i++){
result = result + pow(3,i);
}
printf("The adding value of the position %d is: %d",n, result);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
১৩ . ফাংলন বযব঵ার িয়র সিভু য়জর প্েিফ঱ সনর্ণয়ের স঴ প্রাগ্রাম স঱খ(বাহুগুয়঱ার মান প্দওো আয়ছ)
#include<stdio.h>
#include<conio.h>
#include<math.h>
double area_of_triangle(double a,double b,double c);
main(){
double a,b,c, area;
printf("Enter the side f triangle:");
scanf("%lf %lf %lf", &a, &b ,&c);
area = area_of_triangle(a,b,c);
printf("Area of the Triangle: %lf", area);
getch();
}
double area_of_triangle(double a,double b,double c){
double s, area;
s = (a+b+c)/2;
area = sqrt(s*(s-a)*(s-b)*(s-c));
return area;
}
https://icttutorialforall.blogspot.com
১৪. এিসি ঴া঱ ইনপুি সনয়ে leaf year সিনা যাচাই িরার স঴ প্রাগ্রাম
#include<stdio.h>
#include<conio.h>
main()
{
int y;
printf("Enter a year:");
scanf("%d",&y);
if (y % 400== 0){
printf("%d is a Leap year", y);
}
else if ((y % 100 != 0) && (y % 4==0)){
printf("%d is a Leap year", y);
}
else{
printf("%d is not a Leap year", y);
}
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
১৫. এিসি ঴ংখযা ইনপুি সনয়ে তা প্জাড় না সবয়জাড় তা যাচাই িরার স঴ প্রাগ্রাম
#include<stdio.h>
#include<conio.h>
main()
{
int a;
printf("Enter a number: ");
scanf("%d", &a);
if (a%2==0){
printf("nThe number %d is even.",a);
}
else{
printf("nThe number %d is odd.",a);
}
getch();
}
https://icttutorialforall.blogspot.com
১৬ . সিভু য়জর ৩সি বাহুর মান প্দওো আয়ছ সিভু য়জর প্েিফ঱ সনর্ণয়ের জনয স঴ প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int a, b, c;
float s, area;
printf("Enter 3 integer values :");
scanf("%d %d %d", &a,&b,&c);
s = (a + b + c)/2;
area = sqrt(s*(s-a)*(s-b)*(s-c));
printf("Area of triangle is = %f", area);
getch();
}
১৭. আেতািার প্েয়ির প্েিফ঱ সনর্ণয়ের জনয স঴ প্রাগ্রাম স঱খ।(দদঘণয ও রস্থ্ প্দওো আয়ছ)
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,x;
printf("Enter the length & width: ");
scanf("%d %d",&a,&b);
x=a*b;
printf("nThe area is %d",x);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
১৮. বৃয়ের প্েিফ঱ সনর্ণয়ের জনয স঴ প্রাগ্রাম স঱খ। ( বৃয়ের বযা঴াধ্ণ প্দওো আয়ছ)
#include<stdio.h>
#include<conio.h>
main ( )
{
int r;
float area;
printf ("Enter integer value for radius:");
scanf ("%d", &r) ;
area = 3.14*r*r;
printf("n Area of circle =%f", area);
getch();
}
১৯. প্িান পসরমাপ ফু িয়ি সমিায়র রিাল িরা স঴ প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main()
{
float m,f;
printf("Enter feet: ");
scanf("%f",&f);
m= f/3.28;
printf("n Meter is %.2f",m);
getch();
}
২০. প্িান পসরমাপ ইসঞ্চয়ি প্঴সিসমিায়র রিাল িরা স঴ প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main( )
{
int inch;
float cm;
printf ("Integer value for inches:");
scanf ("%d", &inch) ;
cm=inch*2.54;
printf("nCentimeter=%.2f", cm);
getch();
}
২১. দুইসি ঴ংখযার ময়ধ্য বড় ঴ংখযা সনর্ণয়ের জনয িসিলনা঱ অপায়রির বযব঵ার িয়র স঴ ভা঳াে প্রাগ্রাম স঱খ
#include <stdio.h>
#include <conio.h>
main( )
{
int x,y;
printf("Enter the first number: ");
scanf("%d",&x);
printf("Enter the second number: ");
scanf("%d",&y);
printf("Maximum number:%d",(x>y)?x:y);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
২২. for loop বযব঵ার িয়র ICT Private Program প্঱খাসি ১০ বার সরি িরার স঴ ভা঳াে প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main()
{
int i;
for(i = 1; i = 10; i++)
{
printf("ICT Private Programn");
}
getch();
}
https://icttutorialforall.blogspot.com
===================while loop======================================
#include<stdio.h>
#include<conio.h>
main(){
int a=1;
while(a<=10);
{
printf("ICT Private Programn");
a++;
}
getch();
}
====================do while loop=====================
#include<stdio.h>
#include<conio.h>
main(){
int a=1;
do
{
printf("ICT Private Programn");
a++;
} while(a<=10);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
২৩. ১ প্েয়ি ১০ পযণন্ত ঴ংখযা সরি িরার স঴ ভা঳াে প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main(){
int a;
for(a=1;a<=10; a++)
{
printf("%dt ",a);
}
getch();
}
======================while loop=========================
#include<stdio.h>
#include<conio.h>
main(){
int a=1;
while(a<=10)
{
printf("%dt ",a);
a++;
}
getch();
}
https://icttutorialforall.blogspot.com
======================do while loop=========================
#include<stdio.h>
#include<conio.h>
main(){
int a=1;
do
{
printf("%dt ",a);
a++;
} while(a<=10);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
২৪. ১ প্েয়ি ২০ পযণন্ত সবয়জাড় ঴ংখযা প্দখায়নার জনয প্রাগ্রাম
#include<stdio.h>
#include<conio.h>
main(){
int a;
for(a=1;a<=20; a=a+2){
printf("%dt ",a);
}
getch();
}
=================================
#include<stdio.h>
#include<conio.h>
main(){
int a=1;
while(a<=20){
printf("%dt ",a);
a=a+2;
}
getch();
}
https://icttutorialforall.blogspot.com
====================================
#include<stdio.h>
#include<conio.h>
main(){
int a=1;
do{
printf("%dt ",a);
a=a+2;
} while(a<=20);
getch();
}
২৫. ১ প্েয়ি ২০ পযণন্ত প্জাড় ঴ংখযা প্দখায়নার জনয প্রাগ্রাম।
#include<stdio.h>
#include<conio.h>
main(){
int a;
for(a=1;a<=20; a=a+1){
if(a%2 == 0){
printf("%dt ",a);
}
}
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
===================================
#include<stdio.h>
#include<conio.h>
main(){
int a=1;
while(a<=20){
if(a%2 == 0){
printf("%dt ",a);
}
a=a+1;
}
getch();
}
===================================
#include<stdio.h>
#include<conio.h>
main(){
int a=1;
do{
if(a%2 == 0){
printf("%dt ",a);
}
a=a+1;
} while(a<=20);
getch();
}
https://icttutorialforall.blogspot.com
২৬. ১ প্েয়ি n পযণন্ত ঴ংখযা প্দখায়নার জনয স঴ ভা঳াে প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main(){
int a, n;
printf("Value of n: ");
scanf("%d",&n);
for(a=1;a<=n; a=a+1)
{
printf("%dt ",a);
}
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
====================================
#include<stdio.h>
#include<conio.h>
main(){
int a, n;
printf("Value of n: ");
scanf("%d",&n);
a=1;
while(a<=n)
{
printf("%dt ",a);
a=a+1;
}
getch();
}
================================================
#include<stdio.h>
#include<conio.h>
main(){
int a, n;
printf("Value of n: ");
scanf("%d",&n);
a=1;
do
{
printf("%dt ",a);
a=a+1;
} while(a<=n);
getch();
}
https://icttutorialforall.blogspot.com
২৭. ১ প্েয়ি ১০০ পযণন্ত ঴ংখযার প্যাগফয়঱র প্দখায়নার প্রাগ্রাম স঱খ।
 ১+২+৩+৪+..........................+১০০ ধ্ারার প্যাগফ঱ প্দখায়নার প্রাগ্রাম
#include<stdio.h>
#include<conio.h>
main(){
int a,s=0;
for(a=1;a<=100; a=a+1)
{
s=s+a;
}
printf("Sum=%d ",s);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
======================================
#include<stdio.h>
#include<conio.h>
main(){
int a=1,s=0;
while(a<=100)
{
s=s+a;
a=a+1;
}
printf("Sum=%d ",s);
getch();
}
========================================
#include<stdio.h>
#include<conio.h>
main(){
int a=1,s=0;
do
{
s=s+a;
a=a+1;
} while(a<=100);
printf("Sum=%d ",s);
getch();
}
https://icttutorialforall.blogspot.com
২৮. ১ প্েয়ি ১০০ সবয়জাড় পযণন্ত ঴ংখযার প্যাগফয়঱র প্দখায়নার প্রাগ্রাম স঱খ।
১+৩+৫+..........................+১০০ ধ্ারার প্যাগফ঱ প্দখায়নার প্রাগ্রাম
#include<stdio.h>
#include<conio.h>
main(){
int a,s=0;
for(a=1;a<=100; a=a+2)
{
s=s+a;
}
printf("Sum=%d ",s);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
====================================
#include<stdio.h>
#include<conio.h>
main(){
int a=1,s=0;
while(a<=100)
{
s=s+a;
a=a+2;
}
printf("Sum=%d ",s);
getch();
}
====================================
#include<stdio.h>
#include<conio.h>
main(){
int a=1,s=0;
do
{
s=s+a;
a=a+2;
} while(a<=100);
printf("Sum=%d ",s);
getch();
}
https://icttutorialforall.blogspot.com
২৯. ১ প্েয়ি ১০০ প্জাড় পযণন্ত ঴ংখযার প্যাগফয়঱র প্দখায়নার প্রাগ্রাম স঱খ।
২+৪+৬+..........................+১০০ ধ্ারার প্যাগফ঱ প্দখায়নার প্রাগ্রাম
#include<stdio.h>
#include<conio.h>
main(){
int a,s=0;
for(a=2;a<=100; a=a+2)
{
s=s+a;
}
printf("Sum=%d ",s);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
=============================
#include<stdio.h>
#include<conio.h>
main(){
int a=2,s=0;
while(a<=100)
{
s=s+a;
a=a+2;
}
printf("Sum=%d ",s);
getch();
}
===================================
#include<stdio.h>
#include<conio.h>
main(){
int a=2,s=0;
do
{
s=s+a;
a=a+2;
} while(a<=100);
printf("Sum=%d ",s);
getch();
}
https://icttutorialforall.blogspot.com
৩০. ১ প্েয়ি n প্জাড় পযণন্ত ঴ংখযার প্যাগফয়঱র প্দখায়নার প্রাগ্রাম স঱খ।
২+৪+৬+..........................+n ধ্ারার প্যাগফ঱ প্দখায়নার প্রাগ্রাম ।
#include<stdio.h>
#include<conio.h>
main(){
int a,s,n;
s=0;
printf("Enter Value of n: ");
scanf("%d",&n);
for(a=1;a<=n; a++)
{
s=s+a;
}
printf("Sum=%d ",s);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
=================================
#include<stdio.h>
#include<conio.h>
main(){
int a,s,n;
s=0;
printf("Enter Value of n: ");
scanf("%d",&n);
a=1;
while(a<=n)
{
s=s+a;
a=a+1;
}
printf("Sum=%d ",s);
getch();
}
=================================
#include<stdio.h>
#include<conio.h>
main(){
int a,s,n;
s=0;
printf("Enter Value of n: ");
scanf("%d",&n);
a=1;
do
{
s=s+a;
a=a+1;
} while(a<=n);
printf("Sum=%d ",s);
getch();
}
৩১. ১২
+২২
+৩২
................................+n ধোযোয প্মোগপর প্েখোমনোয প্রোগ্রোভ ।
#include<stdio.h>
#include<conio.h>
main(){
int a,s,n;
s=0;
printf("Enter Value of n: ");
scanf(“%d”,&n);
for(a=1;a<=n;a++)
{
s=s+a*a;
}
printf(“Sum: %d”,s);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
======================================
#include<stdio.h>
#include<conio.h>
main(){
int a,s,n;
s=0;
printf("Enter Value of n: ");
printf("Value of n: ");
scanf("%d",&n);
a=1;
while(a<=n)
{
s=s+a*a;
a=a+1;
}
printf("Sum=%d ",s);
getch();
}
https://icttutorialforall.blogspot.com
#include<stdio.h>
#include<conio.h>
main(){
int a,s,n;
s=0;
printf("Enter Value of n: ");
scanf("%d",&n);
a=1;
do
{
s=s+a*a;
a=a+1;
} while(a<=n);
printf("Sum=%d ",s);
getch();
}
৩২. রেম পদ, রসত পয়দর বৃসি, এবং প্ল঳ পদ িীয়বার্ণ প্েয়ি ইনপুি সনয়ে ধ্ারাসি সনর্ণে ির।
#include<stdio.h>
#include<conio.h>
main(){
int a,i,n,j;
printf("Enter Initialize value:");
scanf("%d",&a);
printf("Enter increment value:");
scanf("%d",&i);
printf("Enter last value:");
scanf("%d",&n);
for(j=a;j<=n; j=j+i)
{
printf("%dt ",j);
}
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
======================================
#include<stdio.h>
#include<conio.h>
main(){
int a,i,n,j;
printf("Enter Initialize value:");
scanf("%d",&a);
printf("Enter increment value:");
scanf("%d",&i);
printf("Enter last value:");
scanf("%d",&n);
j=a;
while(j<=n)
{
printf("%dt ",j);
j=j+i;
}
getch();
}
https://icttutorialforall.blogspot.com
================================================
#include<stdio.h>
#include<conio.h>
main(){
int a,i,n,j;
printf("Enter Initialize value:");
scanf("%d",&a);
printf("Enter increment value:");
scanf("%d",&i);
printf("Enter last value:");
scanf("%d",&n);
j=a;
do
{
printf("%dt ",j);
j=j+i;
} while(j<=n);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
৩৩. ১.২+২.৩+৩.৪+ ............................+n(n+1) ধোযোয প্মোগপর প্েখোমনোয প্রোগ্রোভ ।
#include<stdio.h>
#include<conio.h>
main(){
int a,s,n;
s=0;
printf("Enter Value of n: ");
scanf("%d",&n);
for(a=1;a<=n;a++)
{
s=s+a*(a+1);
}
printf("Sum: %d",s);
getch();
}
===============================
#include<stdio.h>
#include<conio.h>
main(){
int a,s,n;
s=0;
printf("Enter Value of n: ");
scanf("%d",&n);
a=1;
while(a<=n)
{
s=s+a*(a+1);
a++;
}
printf("Sum: %d",s);
getch();
}
===========================================
#include<stdio.h>
#include<conio.h>
main(){
int a,s,n;
s=0;
printf("Enter Value of n: ");
scanf("%d",&n);
a=1;
do{
s=s+a*(a+1);
a++;
} while(a<=n);
printf("Sum: %d",s);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
৩৪. প্িান ঴ংখযার ফযাক্টসরো঱ ঴ংখযা সনর্ণয়ের প্রাগ্রাম।
#include<stdio.h>
#include<conio.h>
main(){
int n, i;
long f=1;
printf("Enter a number: ");
scanf("%d", &n);
for(i=1; i<=n; i++) {
f=f*i;
}
printf("Factorial is %ld", f);
getch();
}
====================================
#include<stdio.h>
#include<conio.h>
main(){
int n, i=1;
long f=1;
printf("Enter a number: ");
scanf("%d", &n);
while(i<=n){
f=f*i;
i++;
}
printf("Factorial is %ld", f);
getch();
}
========================================
#include<stdio.h>
#include<conio.h>
main(){
int n, i=1;
long f=1;
printf("Enter a number: ");
scanf("%d", &n);
do{
f=f*i;
i++;
}while(i<=n);
printf("Factorial is %ld", f);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
৩৫. িীয়বার্ণ প্েয়ি ইনপুি সনয়ে দুইসি ঴ংখযার গ.঴া.গু সনর্ণয়ের প্রাগ্রাম স঱খ।
#include <stdio.h>
#include<conio.h>
main(){
int l, s, i, gcd;
printf("Enter large value: ");
scanf("%d", &l);
printf("Enter small value: ");
scanf("%d", &s);
for(i=1; i<=l || i<=s; ++i){
if(l%i==0 && s%i==0)
gcd=i;
}
printf("GCD=%d", gcd);
getch();
}
====================================
#include <stdio.h>
#include<conio.h>
main(){
int l, s, i, gcd;
printf("Enter large value: ");
scanf("%d", &l);
printf("Enter small value: ");
scanf("%d", &s);
while(l%s!=0)
{
r = l%s;
l = s;
s = r;
}
printf("GCD=%d", s);
getch();
}
========================================
#include <stdio.h>
#include<conio.h>
main(){
int l, s, i, gcd;
printf("Enter large value: ");
scanf("%d", &l);
printf("Enter small value: ");
scanf("%d", &s);
do{
r = l %s;
l = s;
s = r;
}while(l%s!=0);
printf("GCD=%d", s);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,x;
printf("Type the two number: ");
scanf("%d %d",&a,&b);
x=(a<b)?a:b;
again:
if(a%x==0 && b%x==0)
printf("GCD of %d and %d is %d",a,b,x);
else
{
x=x-1;
goto again;
}
getch();
}
https://icttutorialforall.blogspot.com
৩৬. দুইসি পূর্ণ ঴ংখযার ঱.঴া.গু সনর্ণে ির।
#include<stdio.h>
#include<conio.h>
main(){
int a,b,i,flag=0;
printf("Type the two number:");
scanf("%d %d",&a,&b);
for(i=1;i<=a*b && flag==0;i++){
if(i%a == 0 && i%b == 0 ){
flag++;
printf("LCM is %d",i);
}
}
getch();
}
=====================================================================
#include<stdio.h>
#include<conio.h>
main()
{
int n1, n2, i, gcd, lcm;
printf("Enter two positive integers: ");
scanf("%d %d",&n1,&n2);
for(i=1; i <= n1 && i <= n2; ++i)
{
// Checks if i is factor of both integers
if(n1%i==0 && n2%i==0)
gcd = i;
}
lcm = (n1*n2)/gcd;
printf("The LCM of two numbers %d and %d is %d.", n1, n2, lcm);
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
========================= গ.঴া.গু এবং ঱.঴া.গু================
#include<stdio.h>
#include<conio.h>
main(){
int a, b, x, y, t, gcd, lcm;
printf("Enter two integersn");
scanf("%d%d", &x, &y);
a = x;
b = y;
while (b != 0) {
t = b;
b = a % b;
a = t;
}
gcd = a;
lcm = (x*y)/gcd;
printf("Greatest common divisor of %d and %d = %dn", x, y, gcd);
printf("Least common multiple of %d and %d = %dn", x, y, lcm);
}
https://icttutorialforall.blogspot.com
৩৭. িীয়বার্ণ প্েয়ি ইনপুি সনয়ে সতনসি ঴ংখযার ঱.঴া.গু সনর্ণয়ের প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main(){
int a,b,c,i,flag=0;
printf("Type the three number:");
scanf("%d %d %d",&a,&b,&c);
for(i=1;i<=a*b*c && flag==0;i++){
if(i%a == 0 && i%b == 0 && i%c == 0){
flag++;
printf("LCM is %d",i);
}
}
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
৩৮ . রাইম নম্বর প্বর িরার স঴ প্রাগ্রাম।
#include<stdio.h>
#include<conio.h>
int main()
{
int n, i;
printf("Enter a number to check if it is primen");
scanf("%d", &n);
for(i=2; i<n; i++)
{
if(n%i == 0){
printf("%d is not prime. n",n);
break;
}
}
if(i==n){
printf("%d is prime. n",n);
return 0;
}
getch();
}
https://icttutorialforall.blogspot.com
===========================================================================
#include<stdio.h>
#include<conio.h>
main(){
int n, i, s;
printf("Enter a numbern");
scanf("%d", &n);
for (i=2; i<=n-1; i++){
s=n%i;
if (s==0) {
printf("%d is not prime number",n);
break;
}
}
if (s!=0) printf("%d is prime number", n);
getch();
}
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
৩৯. অযায়র বযব঵ার িয়র সফয়বানাসি স঴সরয়জর মান সনর্ণয়ের জনয স঴ ভা঳াে প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main(){
int n, i, a[100];
printf("How many fibonacci number? ");
scanf("%d",&n);
printf("Enter 1st & 2nd number : ");
scanf("%d %d", &a[1], &a[2]);
for(i=3; i<=n; i++){
a[i]=a[i-1]+a[i-2];
printf("n Fibonacci number %d", a[i]);
}
}
https://icttutorialforall.blogspot.com
৪০. goto প্েিয়মি বযব঵ার িয়র ফযায়ক্টাসরো঱ মান প্বর িরার স঴ প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main(){
int a,x;
long fact=1;
start:
printf("nType the positive integer: ");
scanf("%d",&x);
if(x<0){
printf("Negative number not allowed. ");
goto start;
}
else if(x==0)
printf("Factorial=1");
else{
for(a=2;a<=x;a++)
fact=fact*a;
printf("Factorial=%ld",fact);
}
getch();
}
৪১. এিসি এিমাসিি অযায়র ৫ সি ঴ংখযা সনয়ে উক্ত ৫সি ঴ংখযা সরি িরার স঴ প্রাগ্রাম স঱খ।
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
#include<stdio.h>
#include<conio.h>
void main()
{
int j;
int marks[5]={11, 23, 35, 42, 36};
printf("One Dimensional Array Elementsn");
for(j=0;j<5;j++)
{
printf("%dt",marks[j]);
}
printf("n") ;
getch();
}
৪২. অযায়র বযব঵ার িয়র n ঴ংখযাি ঴ংখযার প্যাগফ঱ সনর্ণয়ের জনয স঴ প্রাগ্রাম স঱খ।
#include<stdio.h>
#include<conio.h>
main(){
int a[10],i,n,s=0;
printf("How many number:");
scanf("%d",&n);
for(i=1;i<=n;++i){
printf("Type the marks: ");
scanf("%d",&a[i]);
s=s+a[i];
}
printf("SUM=%d",s);
getch();
}
৪৩. fuction বযব঵ার িয়র ২সি ঴ংখযা প্যাগ িরার স঴ প্রাগ্রামি স঱খ।
#include <stdio.h>
#include <conio.h>
int add(int a, int b); /*function prototype*/
main(){
int a,b,sum;
printf("Type the first number: ");
scanf("%d",&a);
printf("Type the second number: ");
scanf("%d",&b);
sum = add(a,b);
printf("Sum=%dn",sum);
getch();
}
int add(int a, int b){
int add;
add=a+b;
return add;
}
৪৪. সরিাস঴ণভ ফাংলন বযব঵ার িয়র ফযায়ক্টাসরো঱ মান প্বর িরার স঴ প্রাগ্রাম স঱খ।
বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse
#include<stdio.h>
long int factorial(int n);
main(){
int n,fac;
printf("Type the desire value :");
scanf("%d",&n);
fac = factorial(n);
printf("Factorial value is %ldn",fac);
}
long int factorial(int n){
if (n<=1)
return (1);
else
return (n*factorial(n-1));
}
ওময়ফ িোইট
https://icttutorialforall.blogspot.com/
ইউটিউফ
https://www.youtube.com/amirulislamcse

More Related Content

What's hot

HSC ICT Chapter 1
HSC ICT Chapter 1 HSC ICT Chapter 1
HSC ICT Chapter 1 shitabaziz
 
All bcs-math-solutions
All bcs-math-solutionsAll bcs-math-solutions
All bcs-math-solutionsItmona
 
ICT-Number system.সংখ্যা পদ্ধতি(৩য় অধ্যায়-১ম অংশ)
ICT-Number system.সংখ্যা পদ্ধতি(৩য় অধ্যায়-১ম অংশ)ICT-Number system.সংখ্যা পদ্ধতি(৩য় অধ্যায়-১ম অংশ)
ICT-Number system.সংখ্যা পদ্ধতি(৩য় অধ্যায়-১ম অংশ)United International University
 
HSC ICT: DATABASE MANAGEMENT SYSTEM( bangla Version)
HSC ICT: DATABASE MANAGEMENT SYSTEM( bangla Version)HSC ICT: DATABASE MANAGEMENT SYSTEM( bangla Version)
HSC ICT: DATABASE MANAGEMENT SYSTEM( bangla Version)Adamjee Cantonment College
 
HSC 2023 Management 2nd paper MCQ
HSC 2023 Management 2nd paper MCQHSC 2023 Management 2nd paper MCQ
HSC 2023 Management 2nd paper MCQTajul Isalm Apurbo
 
اردو ترجمہ و تفسير ( التوبة ) ٩ سورۃ القرآن [PDF] ┇ Quran Surah 9 At-Tawbah ...
اردو  ترجمہ و تفسير ( التوبة ) ٩ سورۃ القرآن [PDF] ┇ Quran Surah 9 At-Tawbah ...اردو  ترجمہ و تفسير ( التوبة ) ٩ سورۃ القرآن [PDF] ┇ Quran Surah 9 At-Tawbah ...
اردو ترجمہ و تفسير ( التوبة ) ٩ سورۃ القرآن [PDF] ┇ Quran Surah 9 At-Tawbah ...Quran Juz (Para)
 
Iba mcq math solution( 2017 2019) by khairul alam [www.itmona.com]
Iba mcq math solution( 2017 2019) by khairul alam  [www.itmona.com]Iba mcq math solution( 2017 2019) by khairul alam  [www.itmona.com]
Iba mcq math solution( 2017 2019) by khairul alam [www.itmona.com]Itmona
 

What's hot (20)

Chapter 01: global village
Chapter 01: global village Chapter 01: global village
Chapter 01: global village
 
HSC ICT: Chapter 6 Board MCQ Solution
HSC ICT:  Chapter 6 Board  MCQ SolutionHSC ICT:  Chapter 6 Board  MCQ Solution
HSC ICT: Chapter 6 Board MCQ Solution
 
HSC ICT Chapter 1
HSC ICT Chapter 1 HSC ICT Chapter 1
HSC ICT Chapter 1
 
HTML-Bangla E-book
HTML-Bangla E-bookHTML-Bangla E-book
HTML-Bangla E-book
 
All bcs-math-solutions
All bcs-math-solutionsAll bcs-math-solutions
All bcs-math-solutions
 
ICT-Number system.সংখ্যা পদ্ধতি(৩য় অধ্যায়-১ম অংশ)
ICT-Number system.সংখ্যা পদ্ধতি(৩য় অধ্যায়-১ম অংশ)ICT-Number system.সংখ্যা পদ্ধতি(৩য় অধ্যায়-১ম অংশ)
ICT-Number system.সংখ্যা পদ্ধতি(৩য় অধ্যায়-১ম অংশ)
 
Lecturer 1 data communication system
Lecturer 1 data communication systemLecturer 1 data communication system
Lecturer 1 data communication system
 
Lecturer 5 computer networking
Lecturer  5 computer networkingLecturer  5 computer networking
Lecturer 5 computer networking
 
Number system and digital device (Chapter 3)
Number system and digital device (Chapter 3)Number system and digital device (Chapter 3)
Number system and digital device (Chapter 3)
 
Bangla html
Bangla htmlBangla html
Bangla html
 
Allah ki Tareef
Allah ki TareefAllah ki Tareef
Allah ki Tareef
 
HSC ICT: DATABASE MANAGEMENT SYSTEM( bangla Version)
HSC ICT: DATABASE MANAGEMENT SYSTEM( bangla Version)HSC ICT: DATABASE MANAGEMENT SYSTEM( bangla Version)
HSC ICT: DATABASE MANAGEMENT SYSTEM( bangla Version)
 
HSC_ICT_Ch04_01_intro
HSC_ICT_Ch04_01_introHSC_ICT_Ch04_01_intro
HSC_ICT_Ch04_01_intro
 
HSC 2023 Management 2nd paper MCQ
HSC 2023 Management 2nd paper MCQHSC 2023 Management 2nd paper MCQ
HSC 2023 Management 2nd paper MCQ
 
Malayalam teaching manual
Malayalam teaching manualMalayalam teaching manual
Malayalam teaching manual
 
Having a baby bangla
Having a baby banglaHaving a baby bangla
Having a baby bangla
 
Css3 cheat-sheet
Css3 cheat-sheetCss3 cheat-sheet
Css3 cheat-sheet
 
اردو ترجمہ و تفسير ( التوبة ) ٩ سورۃ القرآن [PDF] ┇ Quran Surah 9 At-Tawbah ...
اردو  ترجمہ و تفسير ( التوبة ) ٩ سورۃ القرآن [PDF] ┇ Quran Surah 9 At-Tawbah ...اردو  ترجمہ و تفسير ( التوبة ) ٩ سورۃ القرآن [PDF] ┇ Quran Surah 9 At-Tawbah ...
اردو ترجمہ و تفسير ( التوبة ) ٩ سورۃ القرآن [PDF] ┇ Quran Surah 9 At-Tawbah ...
 
Iba mcq math solution( 2017 2019) by khairul alam [www.itmona.com]
Iba mcq math solution( 2017 2019) by khairul alam  [www.itmona.com]Iba mcq math solution( 2017 2019) by khairul alam  [www.itmona.com]
Iba mcq math solution( 2017 2019) by khairul alam [www.itmona.com]
 
C Programming Exam problems & Solution by sazzad hossain
C Programming Exam problems & Solution by sazzad hossainC Programming Exam problems & Solution by sazzad hossain
C Programming Exam problems & Solution by sazzad hossain
 

HSC ICT c program question answer/program solve

  • 1. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse পঞ্চম অধ্যায়ে স঴ প্রাগ্রাম- সিছু গুরুত্বপূর্ণ ঴ম঴যা ঴মাধ্ান ============================================================================================== ১. ICT PRIVATE program প্঱খা ছাপায়নার জনয স঴ ভা঳াে প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main() { printf("ICT PRIVATE PROGRAM"); getch(); } ২. সিয়বার্ণ প্েয়ি দুইসি ঴ংখযা ইনপুি সনয়ে প্যাগ িরার এিসি প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main() { int a, b, sum; printf(" Type the first number: "); scanf("%d",&a); printf("Type the second number:"); scanf("%d",&b); sum = a+b; printf("Summation = %d",sum); getch(); } https://icttutorialforall.blogspot.com ৩. সিয়বার্ণ প্েয়ি দুইসি ঴ংখযা ইনপুি সনয়ে সবয়োগ িরার প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main() { int a, b, sub; printf(" Type the first number: "); scanf("%d",&a); printf("Type the second number: "); scanf("%d",&b); sub = a-b; printf("Subtraction= %d",sub); getch(); } 1 st update: 03-08-2016 2 nd update: 07-04-2017
  • 2. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ৪. সিয়বার্ণ প্েয়ি দুইসি ঴ংখযা ইনপুি সনয়ে গুন িরার স঴ ভা঳াে প্রাগ্রাম। #include<stdio.h> #include<conio.h> main() { int a, b, mul; printf(" Type the first number: "); scanf("%d",&a); printf(" Type the second number: "); scanf("%d",&b); mul = a*b; printf("Multiplication= %d", mul); getch(); } https://icttutorialforall.blogspot.com ৫. সিয়বার্ণ প্েয়ি দুইসি ঴ংখযা ইনপুি সনয়ে ভাগ িরার স঴ ভা঳াে প্রাগ্রাম। #include<stdio.h> #include<conio.h> main() { int a, b; float div; printf("Type the first number: "); scanf("%d",&a); printf("Type the second number: "); scanf("%d",&b); div = a/b; printf("Division= %f",div); getch(); } ৬. প্঴঱স঴ো঴ প্েয়ি ফারয়ন঵াইি প্বর িরার জনয স঴ ভা঳াে প্রাগ্রাম। #include<stdio.h> #include<conio.h> main() { int c; float fer; printf("Enter celcious temperature :"); scanf("%d",&c); f=9*c/5+32; printf("Ferhenheight temperature:%f”,fer); getch(); }
  • 3. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ৭. ফারয়ন঵াইি প্েয়ি প্঴঱স঴ো঴ প্বর িরার জনয স঴ ভা঳াে প্রাগ্রাম। #include<stdio.h> #include<conio.h> main() { int fer; float c; printf("Enter Ferenheight temperature :"); scanf("%d",&fer); c=5*(f-32)/9; printf("Celcious temperature:%f”,c); getch(); } ৮. সিভু য়জর প্েিফ঱ সনর্ণে িরার জনয স঴ ভা঳াে এিসি প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main() { int b,h; float area; printf("Enter the Base:"); scanf("%d",&b); printf("Enter the Height:"); scanf("%d", &h); area=.5*b*h; printf("nThe area is %.2f",area); getch(); } https://icttutorialforall.blogspot.com ৯. ২ প্েয়ি ১০০ পযণন্ত ঴ংখযাগুয়঱া প্যাগ িরার স঴ প্রাগ্রাম। #include<stdio.h> #include<conio.h> int main() { int i, sum; sum=0; for(i=2; i<=100; i+=2) { sum=sum+i; } printf("sum %d", sum); return 0; getch(); }
  • 4. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ১০. ওোন র্াইয়মনলনা঱ অযায়র ৫সি ঴ংখযা ইনপুি সনয়ে তা for loop এর মাধ্যয়ম প্দখাও। #include<stdio.h> #include<stdio.h> main() { int i; int marks[5]={20, 25, 30, 17, 14}; printf("one dimension array Elements in 5n"); for(i = 0; i<5; i++){ printf("%d n", marks[i]); } getch(); } https://icttutorialforall.blogspot.com ১১. a প্েয়ি z পযণন্ত অের গুয়঱া প্দখায়না জনয স঴ ভা঳াে প্রাগ্রাম স঱খ। // litter A to Z show screen #include<stdio.h> #include<stdio.h> main() { char alphabet = 'a'; do printf("%c n", alphabet++); while(alphabet<='z'); getch(); } ১২. ১+৩+৯+২৭+................................+n িংখ্যক ঩মযন্ত প্মোগপর বনর্ যয় কযোময় বি প্রোগ্রোভ। #include<stdio.h> #include<conio.h> #include<math.h> main(){ int i,n,result; result = 0; printf("Enter the nth value:"); scanf("%d",&n); for(i = 0; i < n; i++){ result = result + pow(3,i); } printf("The adding value of the position %d is: %d",n, result); getch(); }
  • 5. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ১৩ . ফাংলন বযব঵ার িয়র সিভু য়জর প্েিফ঱ সনর্ণয়ের স঴ প্রাগ্রাম স঱খ(বাহুগুয়঱ার মান প্দওো আয়ছ) #include<stdio.h> #include<conio.h> #include<math.h> double area_of_triangle(double a,double b,double c); main(){ double a,b,c, area; printf("Enter the side f triangle:"); scanf("%lf %lf %lf", &a, &b ,&c); area = area_of_triangle(a,b,c); printf("Area of the Triangle: %lf", area); getch(); } double area_of_triangle(double a,double b,double c){ double s, area; s = (a+b+c)/2; area = sqrt(s*(s-a)*(s-b)*(s-c)); return area; } https://icttutorialforall.blogspot.com ১৪. এিসি ঴া঱ ইনপুি সনয়ে leaf year সিনা যাচাই িরার স঴ প্রাগ্রাম #include<stdio.h> #include<conio.h> main() { int y; printf("Enter a year:"); scanf("%d",&y); if (y % 400== 0){ printf("%d is a Leap year", y); } else if ((y % 100 != 0) && (y % 4==0)){ printf("%d is a Leap year", y); } else{ printf("%d is not a Leap year", y); } getch(); }
  • 6. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ১৫. এিসি ঴ংখযা ইনপুি সনয়ে তা প্জাড় না সবয়জাড় তা যাচাই িরার স঴ প্রাগ্রাম #include<stdio.h> #include<conio.h> main() { int a; printf("Enter a number: "); scanf("%d", &a); if (a%2==0){ printf("nThe number %d is even.",a); } else{ printf("nThe number %d is odd.",a); } getch(); } https://icttutorialforall.blogspot.com ১৬ . সিভু য়জর ৩সি বাহুর মান প্দওো আয়ছ সিভু য়জর প্েিফ঱ সনর্ণয়ের জনয স঴ প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> #include<math.h> main() { int a, b, c; float s, area; printf("Enter 3 integer values :"); scanf("%d %d %d", &a,&b,&c); s = (a + b + c)/2; area = sqrt(s*(s-a)*(s-b)*(s-c)); printf("Area of triangle is = %f", area); getch(); } ১৭. আেতািার প্েয়ির প্েিফ঱ সনর্ণয়ের জনয স঴ প্রাগ্রাম স঱খ।(দদঘণয ও রস্থ্ প্দওো আয়ছ) #include<stdio.h> #include<conio.h> main() { int a,b,x; printf("Enter the length & width: "); scanf("%d %d",&a,&b); x=a*b; printf("nThe area is %d",x); getch(); }
  • 7. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ১৮. বৃয়ের প্েিফ঱ সনর্ণয়ের জনয স঴ প্রাগ্রাম স঱খ। ( বৃয়ের বযা঴াধ্ণ প্দওো আয়ছ) #include<stdio.h> #include<conio.h> main ( ) { int r; float area; printf ("Enter integer value for radius:"); scanf ("%d", &r) ; area = 3.14*r*r; printf("n Area of circle =%f", area); getch(); } ১৯. প্িান পসরমাপ ফু িয়ি সমিায়র রিাল িরা স঴ প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main() { float m,f; printf("Enter feet: "); scanf("%f",&f); m= f/3.28; printf("n Meter is %.2f",m); getch(); } ২০. প্িান পসরমাপ ইসঞ্চয়ি প্঴সিসমিায়র রিাল িরা স঴ প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main( ) { int inch; float cm; printf ("Integer value for inches:"); scanf ("%d", &inch) ; cm=inch*2.54; printf("nCentimeter=%.2f", cm); getch(); } ২১. দুইসি ঴ংখযার ময়ধ্য বড় ঴ংখযা সনর্ণয়ের জনয িসিলনা঱ অপায়রির বযব঵ার িয়র স঴ ভা঳াে প্রাগ্রাম স঱খ #include <stdio.h> #include <conio.h> main( ) { int x,y; printf("Enter the first number: "); scanf("%d",&x); printf("Enter the second number: "); scanf("%d",&y); printf("Maximum number:%d",(x>y)?x:y); getch(); }
  • 8. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ২২. for loop বযব঵ার িয়র ICT Private Program প্঱খাসি ১০ বার সরি িরার স঴ ভা঳াে প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main() { int i; for(i = 1; i = 10; i++) { printf("ICT Private Programn"); } getch(); } https://icttutorialforall.blogspot.com ===================while loop====================================== #include<stdio.h> #include<conio.h> main(){ int a=1; while(a<=10); { printf("ICT Private Programn"); a++; } getch(); } ====================do while loop===================== #include<stdio.h> #include<conio.h> main(){ int a=1; do { printf("ICT Private Programn"); a++; } while(a<=10); getch(); }
  • 9. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ২৩. ১ প্েয়ি ১০ পযণন্ত ঴ংখযা সরি িরার স঴ ভা঳াে প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main(){ int a; for(a=1;a<=10; a++) { printf("%dt ",a); } getch(); } ======================while loop========================= #include<stdio.h> #include<conio.h> main(){ int a=1; while(a<=10) { printf("%dt ",a); a++; } getch(); } https://icttutorialforall.blogspot.com ======================do while loop========================= #include<stdio.h> #include<conio.h> main(){ int a=1; do { printf("%dt ",a); a++; } while(a<=10); getch(); }
  • 10. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ২৪. ১ প্েয়ি ২০ পযণন্ত সবয়জাড় ঴ংখযা প্দখায়নার জনয প্রাগ্রাম #include<stdio.h> #include<conio.h> main(){ int a; for(a=1;a<=20; a=a+2){ printf("%dt ",a); } getch(); } ================================= #include<stdio.h> #include<conio.h> main(){ int a=1; while(a<=20){ printf("%dt ",a); a=a+2; } getch(); } https://icttutorialforall.blogspot.com ==================================== #include<stdio.h> #include<conio.h> main(){ int a=1; do{ printf("%dt ",a); a=a+2; } while(a<=20); getch(); } ২৫. ১ প্েয়ি ২০ পযণন্ত প্জাড় ঴ংখযা প্দখায়নার জনয প্রাগ্রাম। #include<stdio.h> #include<conio.h> main(){ int a; for(a=1;a<=20; a=a+1){ if(a%2 == 0){ printf("%dt ",a); } } getch(); }
  • 11. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse =================================== #include<stdio.h> #include<conio.h> main(){ int a=1; while(a<=20){ if(a%2 == 0){ printf("%dt ",a); } a=a+1; } getch(); } =================================== #include<stdio.h> #include<conio.h> main(){ int a=1; do{ if(a%2 == 0){ printf("%dt ",a); } a=a+1; } while(a<=20); getch(); } https://icttutorialforall.blogspot.com ২৬. ১ প্েয়ি n পযণন্ত ঴ংখযা প্দখায়নার জনয স঴ ভা঳াে প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main(){ int a, n; printf("Value of n: "); scanf("%d",&n); for(a=1;a<=n; a=a+1) { printf("%dt ",a); } getch(); }
  • 12. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ==================================== #include<stdio.h> #include<conio.h> main(){ int a, n; printf("Value of n: "); scanf("%d",&n); a=1; while(a<=n) { printf("%dt ",a); a=a+1; } getch(); } ================================================ #include<stdio.h> #include<conio.h> main(){ int a, n; printf("Value of n: "); scanf("%d",&n); a=1; do { printf("%dt ",a); a=a+1; } while(a<=n); getch(); } https://icttutorialforall.blogspot.com ২৭. ১ প্েয়ি ১০০ পযণন্ত ঴ংখযার প্যাগফয়঱র প্দখায়নার প্রাগ্রাম স঱খ।  ১+২+৩+৪+..........................+১০০ ধ্ারার প্যাগফ঱ প্দখায়নার প্রাগ্রাম #include<stdio.h> #include<conio.h> main(){ int a,s=0; for(a=1;a<=100; a=a+1) { s=s+a; } printf("Sum=%d ",s); getch(); }
  • 13. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ====================================== #include<stdio.h> #include<conio.h> main(){ int a=1,s=0; while(a<=100) { s=s+a; a=a+1; } printf("Sum=%d ",s); getch(); } ======================================== #include<stdio.h> #include<conio.h> main(){ int a=1,s=0; do { s=s+a; a=a+1; } while(a<=100); printf("Sum=%d ",s); getch(); } https://icttutorialforall.blogspot.com ২৮. ১ প্েয়ি ১০০ সবয়জাড় পযণন্ত ঴ংখযার প্যাগফয়঱র প্দখায়নার প্রাগ্রাম স঱খ। ১+৩+৫+..........................+১০০ ধ্ারার প্যাগফ঱ প্দখায়নার প্রাগ্রাম #include<stdio.h> #include<conio.h> main(){ int a,s=0; for(a=1;a<=100; a=a+2) { s=s+a; } printf("Sum=%d ",s); getch(); }
  • 14. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ==================================== #include<stdio.h> #include<conio.h> main(){ int a=1,s=0; while(a<=100) { s=s+a; a=a+2; } printf("Sum=%d ",s); getch(); } ==================================== #include<stdio.h> #include<conio.h> main(){ int a=1,s=0; do { s=s+a; a=a+2; } while(a<=100); printf("Sum=%d ",s); getch(); } https://icttutorialforall.blogspot.com ২৯. ১ প্েয়ি ১০০ প্জাড় পযণন্ত ঴ংখযার প্যাগফয়঱র প্দখায়নার প্রাগ্রাম স঱খ। ২+৪+৬+..........................+১০০ ধ্ারার প্যাগফ঱ প্দখায়নার প্রাগ্রাম #include<stdio.h> #include<conio.h> main(){ int a,s=0; for(a=2;a<=100; a=a+2) { s=s+a; } printf("Sum=%d ",s); getch(); }
  • 15. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ============================= #include<stdio.h> #include<conio.h> main(){ int a=2,s=0; while(a<=100) { s=s+a; a=a+2; } printf("Sum=%d ",s); getch(); } =================================== #include<stdio.h> #include<conio.h> main(){ int a=2,s=0; do { s=s+a; a=a+2; } while(a<=100); printf("Sum=%d ",s); getch(); } https://icttutorialforall.blogspot.com ৩০. ১ প্েয়ি n প্জাড় পযণন্ত ঴ংখযার প্যাগফয়঱র প্দখায়নার প্রাগ্রাম স঱খ। ২+৪+৬+..........................+n ধ্ারার প্যাগফ঱ প্দখায়নার প্রাগ্রাম । #include<stdio.h> #include<conio.h> main(){ int a,s,n; s=0; printf("Enter Value of n: "); scanf("%d",&n); for(a=1;a<=n; a++) { s=s+a; } printf("Sum=%d ",s); getch(); }
  • 16. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ================================= #include<stdio.h> #include<conio.h> main(){ int a,s,n; s=0; printf("Enter Value of n: "); scanf("%d",&n); a=1; while(a<=n) { s=s+a; a=a+1; } printf("Sum=%d ",s); getch(); } ================================= #include<stdio.h> #include<conio.h> main(){ int a,s,n; s=0; printf("Enter Value of n: "); scanf("%d",&n); a=1; do { s=s+a; a=a+1; } while(a<=n); printf("Sum=%d ",s); getch(); } ৩১. ১২ +২২ +৩২ ................................+n ধোযোয প্মোগপর প্েখোমনোয প্রোগ্রোভ । #include<stdio.h> #include<conio.h> main(){ int a,s,n; s=0; printf("Enter Value of n: "); scanf(“%d”,&n); for(a=1;a<=n;a++) { s=s+a*a; } printf(“Sum: %d”,s); getch(); }
  • 17. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ====================================== #include<stdio.h> #include<conio.h> main(){ int a,s,n; s=0; printf("Enter Value of n: "); printf("Value of n: "); scanf("%d",&n); a=1; while(a<=n) { s=s+a*a; a=a+1; } printf("Sum=%d ",s); getch(); } https://icttutorialforall.blogspot.com #include<stdio.h> #include<conio.h> main(){ int a,s,n; s=0; printf("Enter Value of n: "); scanf("%d",&n); a=1; do { s=s+a*a; a=a+1; } while(a<=n); printf("Sum=%d ",s); getch(); } ৩২. রেম পদ, রসত পয়দর বৃসি, এবং প্ল঳ পদ িীয়বার্ণ প্েয়ি ইনপুি সনয়ে ধ্ারাসি সনর্ণে ির। #include<stdio.h> #include<conio.h> main(){ int a,i,n,j; printf("Enter Initialize value:"); scanf("%d",&a); printf("Enter increment value:"); scanf("%d",&i); printf("Enter last value:"); scanf("%d",&n); for(j=a;j<=n; j=j+i) { printf("%dt ",j); } getch(); }
  • 18. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ====================================== #include<stdio.h> #include<conio.h> main(){ int a,i,n,j; printf("Enter Initialize value:"); scanf("%d",&a); printf("Enter increment value:"); scanf("%d",&i); printf("Enter last value:"); scanf("%d",&n); j=a; while(j<=n) { printf("%dt ",j); j=j+i; } getch(); } https://icttutorialforall.blogspot.com ================================================ #include<stdio.h> #include<conio.h> main(){ int a,i,n,j; printf("Enter Initialize value:"); scanf("%d",&a); printf("Enter increment value:"); scanf("%d",&i); printf("Enter last value:"); scanf("%d",&n); j=a; do { printf("%dt ",j); j=j+i; } while(j<=n); getch(); }
  • 19. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ৩৩. ১.২+২.৩+৩.৪+ ............................+n(n+1) ধোযোয প্মোগপর প্েখোমনোয প্রোগ্রোভ । #include<stdio.h> #include<conio.h> main(){ int a,s,n; s=0; printf("Enter Value of n: "); scanf("%d",&n); for(a=1;a<=n;a++) { s=s+a*(a+1); } printf("Sum: %d",s); getch(); } =============================== #include<stdio.h> #include<conio.h> main(){ int a,s,n; s=0; printf("Enter Value of n: "); scanf("%d",&n); a=1; while(a<=n) { s=s+a*(a+1); a++; } printf("Sum: %d",s); getch(); } =========================================== #include<stdio.h> #include<conio.h> main(){ int a,s,n; s=0; printf("Enter Value of n: "); scanf("%d",&n); a=1; do{ s=s+a*(a+1); a++; } while(a<=n); printf("Sum: %d",s); getch(); }
  • 20. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ৩৪. প্িান ঴ংখযার ফযাক্টসরো঱ ঴ংখযা সনর্ণয়ের প্রাগ্রাম। #include<stdio.h> #include<conio.h> main(){ int n, i; long f=1; printf("Enter a number: "); scanf("%d", &n); for(i=1; i<=n; i++) { f=f*i; } printf("Factorial is %ld", f); getch(); } ==================================== #include<stdio.h> #include<conio.h> main(){ int n, i=1; long f=1; printf("Enter a number: "); scanf("%d", &n); while(i<=n){ f=f*i; i++; } printf("Factorial is %ld", f); getch(); } ======================================== #include<stdio.h> #include<conio.h> main(){ int n, i=1; long f=1; printf("Enter a number: "); scanf("%d", &n); do{ f=f*i; i++; }while(i<=n); printf("Factorial is %ld", f); getch(); }
  • 21. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ৩৫. িীয়বার্ণ প্েয়ি ইনপুি সনয়ে দুইসি ঴ংখযার গ.঴া.গু সনর্ণয়ের প্রাগ্রাম স঱খ। #include <stdio.h> #include<conio.h> main(){ int l, s, i, gcd; printf("Enter large value: "); scanf("%d", &l); printf("Enter small value: "); scanf("%d", &s); for(i=1; i<=l || i<=s; ++i){ if(l%i==0 && s%i==0) gcd=i; } printf("GCD=%d", gcd); getch(); } ==================================== #include <stdio.h> #include<conio.h> main(){ int l, s, i, gcd; printf("Enter large value: "); scanf("%d", &l); printf("Enter small value: "); scanf("%d", &s); while(l%s!=0) { r = l%s; l = s; s = r; } printf("GCD=%d", s); getch(); } ======================================== #include <stdio.h> #include<conio.h> main(){ int l, s, i, gcd; printf("Enter large value: "); scanf("%d", &l); printf("Enter small value: "); scanf("%d", &s); do{ r = l %s; l = s; s = r; }while(l%s!=0); printf("GCD=%d", s); getch(); }
  • 22. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse #include<stdio.h> #include<conio.h> main() { int a,b,x; printf("Type the two number: "); scanf("%d %d",&a,&b); x=(a<b)?a:b; again: if(a%x==0 && b%x==0) printf("GCD of %d and %d is %d",a,b,x); else { x=x-1; goto again; } getch(); } https://icttutorialforall.blogspot.com ৩৬. দুইসি পূর্ণ ঴ংখযার ঱.঴া.গু সনর্ণে ির। #include<stdio.h> #include<conio.h> main(){ int a,b,i,flag=0; printf("Type the two number:"); scanf("%d %d",&a,&b); for(i=1;i<=a*b && flag==0;i++){ if(i%a == 0 && i%b == 0 ){ flag++; printf("LCM is %d",i); } } getch(); } ===================================================================== #include<stdio.h> #include<conio.h> main() { int n1, n2, i, gcd, lcm; printf("Enter two positive integers: "); scanf("%d %d",&n1,&n2); for(i=1; i <= n1 && i <= n2; ++i) { // Checks if i is factor of both integers if(n1%i==0 && n2%i==0) gcd = i; } lcm = (n1*n2)/gcd; printf("The LCM of two numbers %d and %d is %d.", n1, n2, lcm); }
  • 23. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ========================= গ.঴া.গু এবং ঱.঴া.গু================ #include<stdio.h> #include<conio.h> main(){ int a, b, x, y, t, gcd, lcm; printf("Enter two integersn"); scanf("%d%d", &x, &y); a = x; b = y; while (b != 0) { t = b; b = a % b; a = t; } gcd = a; lcm = (x*y)/gcd; printf("Greatest common divisor of %d and %d = %dn", x, y, gcd); printf("Least common multiple of %d and %d = %dn", x, y, lcm); } https://icttutorialforall.blogspot.com ৩৭. িীয়বার্ণ প্েয়ি ইনপুি সনয়ে সতনসি ঴ংখযার ঱.঴া.গু সনর্ণয়ের প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main(){ int a,b,c,i,flag=0; printf("Type the three number:"); scanf("%d %d %d",&a,&b,&c); for(i=1;i<=a*b*c && flag==0;i++){ if(i%a == 0 && i%b == 0 && i%c == 0){ flag++; printf("LCM is %d",i); } } getch(); }
  • 24. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ৩৮ . রাইম নম্বর প্বর িরার স঴ প্রাগ্রাম। #include<stdio.h> #include<conio.h> int main() { int n, i; printf("Enter a number to check if it is primen"); scanf("%d", &n); for(i=2; i<n; i++) { if(n%i == 0){ printf("%d is not prime. n",n); break; } } if(i==n){ printf("%d is prime. n",n); return 0; } getch(); } https://icttutorialforall.blogspot.com =========================================================================== #include<stdio.h> #include<conio.h> main(){ int n, i, s; printf("Enter a numbern"); scanf("%d", &n); for (i=2; i<=n-1; i++){ s=n%i; if (s==0) { printf("%d is not prime number",n); break; } } if (s!=0) printf("%d is prime number", n); getch(); }
  • 25. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse ৩৯. অযায়র বযব঵ার িয়র সফয়বানাসি স঴সরয়জর মান সনর্ণয়ের জনয স঴ ভা঳াে প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main(){ int n, i, a[100]; printf("How many fibonacci number? "); scanf("%d",&n); printf("Enter 1st & 2nd number : "); scanf("%d %d", &a[1], &a[2]); for(i=3; i<=n; i++){ a[i]=a[i-1]+a[i-2]; printf("n Fibonacci number %d", a[i]); } } https://icttutorialforall.blogspot.com ৪০. goto প্েিয়মি বযব঵ার িয়র ফযায়ক্টাসরো঱ মান প্বর িরার স঴ প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main(){ int a,x; long fact=1; start: printf("nType the positive integer: "); scanf("%d",&x); if(x<0){ printf("Negative number not allowed. "); goto start; } else if(x==0) printf("Factorial=1"); else{ for(a=2;a<=x;a++) fact=fact*a; printf("Factorial=%ld",fact); } getch(); } ৪১. এিসি এিমাসিি অযায়র ৫ সি ঴ংখযা সনয়ে উক্ত ৫সি ঴ংখযা সরি িরার স঴ প্রাগ্রাম স঱খ।
  • 26. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse #include<stdio.h> #include<conio.h> void main() { int j; int marks[5]={11, 23, 35, 42, 36}; printf("One Dimensional Array Elementsn"); for(j=0;j<5;j++) { printf("%dt",marks[j]); } printf("n") ; getch(); } ৪২. অযায়র বযব঵ার িয়র n ঴ংখযাি ঴ংখযার প্যাগফ঱ সনর্ণয়ের জনয স঴ প্রাগ্রাম স঱খ। #include<stdio.h> #include<conio.h> main(){ int a[10],i,n,s=0; printf("How many number:"); scanf("%d",&n); for(i=1;i<=n;++i){ printf("Type the marks: "); scanf("%d",&a[i]); s=s+a[i]; } printf("SUM=%d",s); getch(); } ৪৩. fuction বযব঵ার িয়র ২সি ঴ংখযা প্যাগ িরার স঴ প্রাগ্রামি স঱খ। #include <stdio.h> #include <conio.h> int add(int a, int b); /*function prototype*/ main(){ int a,b,sum; printf("Type the first number: "); scanf("%d",&a); printf("Type the second number: "); scanf("%d",&b); sum = add(a,b); printf("Sum=%dn",sum); getch(); } int add(int a, int b){ int add; add=a+b; return add; } ৪৪. সরিাস঴ণভ ফাংলন বযব঵ার িয়র ফযায়ক্টাসরো঱ মান প্বর িরার স঴ প্রাগ্রাম স঱খ।
  • 27. বফিঃ দ্রিঃ বি প্রোগ্রোমভয িভস্যো িভোধোন – বববিও প্েখমে https://www.youtube.com/amirulislamcse #include<stdio.h> long int factorial(int n); main(){ int n,fac; printf("Type the desire value :"); scanf("%d",&n); fac = factorial(n); printf("Factorial value is %ldn",fac); } long int factorial(int n){ if (n<=1) return (1); else return (n*factorial(n-1)); } ওময়ফ িোইট https://icttutorialforall.blogspot.com/ ইউটিউফ https://www.youtube.com/amirulislamcse