A Personal Collection of CODE (C++) Turbo++ Shamim Mahmud Nazmul Hosen
A Personal Collection of CODE (C++) Turbo++ Shamim Mahmud Nazmul Hosen
A Personal Collection of CODE (C++) Turbo++ Shamim Mahmud Nazmul Hosen
SHAMIM MAHMUD
NAZMUL HOSEN
#include<stdio.h>
void main()
int a;
scanf("%d",&a);
if (a%2==0)
printf("even");
else printf("odd");
#include<stdio.h>
void main()
float a,b,total;
printf("First input=");
scanf("%f",&a);
printf("second input=");
scanf("%f",&b);
printf("Total=");
total=a-b;
printf("%f",total);
#include<stdio.h>
void main()
float a,b,total;
printf("First input=");
scanf("%f",&a);
printf("second input=");
scanf("%f",&b);
printf("Total=");
total=a+b;
printf("%f",total);
#include<stdio.h>
void main()
printf("Hallo Nazmul");
}
1### Write down the CODE of following Equation
12+22+32+……+102=?
#include <stdio.h>
main ()
int i, sum=0;
sum=sum+i*i;
// write a two dimensional array and sum the elements of the array.
#include<stdio.h>
void main()
int a[2][3];
printf("\n");
// write a program that inputs three characters and print their ascii value.
#include<stdio.h>
void main()
char a[3];
}
printf("Print their ascii values: ");
#include<stdio.h>
void main()
char a[3];
#include<stdio.h>
void main()
{
char a[4];
printf("%c", a[j]);
printf("%c", a[k]);
#include<stdio.h>
void main()
char a[34];
#include<stdio.h>
void main()
char ch[34];
int i, length=0;
length++;
printf("%c", ch[k]);
#include<stdio.h>
void main()
int a[2][3];
int sum=0;
scanf("%d", &a[i][j]);
}
// write a two dimensional array and sum the elements of the array.
#include<stdio.h>
void main()
int a[2][3];
printf("\n");
#include<stdio.h>
#include<conio.h>
void main()
{float gpoint;
char gletter;
gletter=getch();
if(gletter=='*')gpoint=5;
else if(gletter=='A')gpoint=4.5;
else if(gletter=='b')gpoint=4;
else if(gletter=='B')gpoint=3.5;
else if(gletter=='F')gpoint=0.0;
printf("%f",gpoint);
#include<stdio.h>
void main()
char letter;
scanf("%c",& letter);
#include<stdio.h>
void main()
{
float mark;
#include<stdio.h>
#include<conio.h>
void main()
char ch;
printf("\nenter a character=");
ch=getch();
switch(ch)
case'*':printf("5.0");break;
case'A':printf("4.0");break;
case'B':printf("3.0");break;
case'C':printf("2.0");break;
case'D':printf("1.0");break;
default:printf("0.0");break;
#include <stdio.h>
void main()
char letter;
scanf("%c",& letter);
#include <stdio.h>
void main()
char letter;
scanf("%c",& letter);
#include<stdio.h>
#include<conio.h>
void main()
{float gpoint;
char gletter;
gletter=getch();
if(gletter=='*')gpoint=5;
else if(gletter=='A')gpoint=4.5;
else if(gletter=='b')gpoint=4;
else if(gletter=='B')gpoint=3.5;
else if(gletter=='F')gpoint=0.0;
printf("%f",gpoint);
void main()
char ch;
scanf("%c",& ch);
if (ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
#include <stdio.h>
void main()
char ch;
scanf("%C",& ch );
switch (ch)
{case 'a':
case 'e':
case 'i':
case 'o':
#include <stdio.h>
void main()
char gl;
float gpa;
switch (gl)
{case '*':gpa=5.0;break;
case 'A':gpa=4.0;break;
case 'B':gpa=3.0;break;
case 'C':gpa=2.0;break;
defult : gpa=0.0;
printf ("GPA=%f",gpa);
#include<stdio.h>
#include<conio.h>
void main()
{float gpoint;
char gletter;
gletter=getch();
if(gletter=='*')gpoint=5;
else if(gletter=='A')gpoint=4.5;
else if(gletter=='b')gpoint=4;
else if(gletter=='B')gpoint=3.5;
else if(gletter=='F')gpoint=0.0;
printf("%f",gpoint);
}
1. addition*/
#include<stdio.h>
void main()
scanf("%f",& a);
scanf("%f",& b);
r=a+b;
printf("result=%f",r);
#include<stdio.h>
void main()
scanf("%f",& a);
scanf("%f",& b);
r=a-b;
printf("result=%f",r);
}
3. /* write a program which doing maltiplication*/
#include<stdio.h>
void main()
scanf("%f",& a);
scanf("%f",& b);
r=a*b;
printf("result=%f",r);
#include<stdio.h>
void main()
scanf("%f",& a);
scanf("%f",& b);
r=a/b;
printf("result=%f",r);
Control statement :
If statement & if else statement
#include<stdio.h>
#include<conio.h>
void main()
int num;
printf ("number:");
scanf("%d",&num);
if(num<0)
else
#include<stdio.h>
void main()
int num;
if (num%2==0)
else
#include<stdio.h>
void main()
int year;
else
// program : if-sign.cpp
#include <stdio.h>
main(void)
int num;
scanf("%d",&num);
if(num<0)
printf(" Negative");
else
printf(" Positive");
return 0;
Odd or Even
#include<stdio.h>
void main()
int num;
printf("Enter a number");
scanf("%d",& num);
if(num%2==0)printf("number is even");
#include<stdio.h>
void main()
float a,b,total;
scanf("%f",&a);
scanf("%f",&b);
total=a+b;
printf("Total=%f",total);
}
#include <stdio.h>
void main()
float l,w,a;
scanf("%f",&l);
scanf("%f",&w);
a=l*w;
printf("Area=%f",a);
#include<stdio.h>
void main()
float radius,area;
scanf ("%f",&radius);
area=3.14*radius*radius;
printf("Area=%f",area);
#include <stdio.h>
main()
{
int number;
scanf("%d",&number);
return 0;
// program : toAscii.cpp
#include <stdio.h>
main(void)
char c;
scanf("%c",&c);
return 0;
#include <conio.h>
#include <stdio.h>
main()
{ char ch;
ch=getche();
ch=ch-32;
return 0;
#include<stdio.h>
main()
float length,width,area;
scanf("%f",&length);
scanf("%f",&width);
area=length*width;
printf("area=%f",area);
return 0;
#include<stdio.h>
void main()
int a,b,c;
scanf ("%d%d%d",&a,&b,&c);
printf("%d is max",a);
printf("%d is max",c);
#include<stdio.h>
void main()
int mark;
scanf ("%d",&mark);
if (mark>80) printf("a+");
#include<stdio.h>
void main()
{char array[]={'a','b','c','d'} ;
char array1[4];
for(int i=0;i<=3;i++)
array1[i]=array[i];
for(i=0;i<=3;i++)
array1[i]=array[3-i];
for(i=0;i<=3;i++)
printf("%c\n",array1[i]);
#include<stdio.h>
void main()
{char array[]={'a','b','c','d'} ;
char array1[4];
for(int i=0;i<=3;i++)
array1[i]=array[i];
for(i=0;i<=3;i++)
array[i]=array1[3-i];
for(i=0;i<=3;i++)
printf("%c\n",array[i]);
#include<stdio.h>
#include<math.h>
void main ()
{int n,b,flag;
flag=1;
scanf ("%d",&n);
b=sqrt(n);
for(int i=2;i<=b;i++)
{
if((n%i)==0)
break;}
else{flag++;}
#include<stdio.h>
void main()
char array[]={'A','B','C','D'};
char array1[3];
int i;
for(i=0;i<=3;i++)
array1[i]=array[i]+32;
for(i=0;i<=3;i++)
printf("%c\n",array1[i]);
#include<stdio.h>
void main()
char array[]={'a','b','c','d'};
char array1[3];
int i;
for(i=0;i<=3;i++)
array1[i]=array[i]-32;
for(i=0;i<=3;i++)
printf("%c\n",array1[i]);
#include<stdio.h>
void main()
char array[]={'A','B','C','D'},t[4];
t[i]=array[i];
for(int i=0;i<=3;i++)
array[i]=t[3-i];
for(i=0;i<=3;i++)
printf("%c",array[i];
#include<stdio.h>
void main()
FILE*fp;
fp=fopen("shoiab","r");
int c;
fscanf(fp,"%d",&c);
fclose(fp);
fp=fopen("shoiab.write","w");
int i;
for(i=0;i<5;i++)
fprintf(fp,"%d\t",i*c);
if(i/5==0)fprintf(fp,"\n");
fclose(fp);
#include<stdio.h>
int to_upper_to_lower(int a)
void main()
char x,y;
scanf("%c",&y);
x=to_upper_to_lower( y);
printf("%c",x);
#include<stdio.h>
void main()
char array[]={'A','B','C','D'},t[4];
t[i]=array[i];
for(int i=0;i<=3;i++)
array[i]=t[3-i];
for(i=0;i<=3;i++)
printf("%c",array[i];
#include<stdio.h>
int factorial(int n)
if(n==1) return 1;
void main()
int x,y;
scanf("%d",&y);
x=factorial(y);
printf("%d",x);
#include<stdio.h>
int i,mul=1;
for(i=1;i<=b;i++)
mul=mul*a;
void main ()
int n;
n= pow(2,3);
printf("%d",n);
17.06.2010
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: