#include <stdio.h>
int main ()
{
    int num1, num2;
    printf("Enter a number = ");
    scanf("%d", &num1);
    printf("enter another number = ");
    scanf("%d", &num2);
    printf("%d + %d = %d\n", num1, num2, num1+num2);
    printf("%d - %d = %d\n", num1 , num2, num1-num2);
    printf("%d * %d = %d\n", num1, num2, num1*num2);
    printf("%d / %d = %d\n", num1, num2, num1/num2);
    return 0;
}

asked 04 Nov, 22:13

Sanan's gravatar image

Sanan
111

edited 05 Nov, 06:50

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
60618


হেডার ফাইলটি পরিবর্তন করলেই হবে।

#include <cstdio>

int main ()
{
    int num1, num2;

    printf("Enter a number = ");
    scanf("%d", &num1);
    printf("enter another number = ");
    scanf("%d", &num2);
    printf("%d + %d = %d\n", num1, num2, num1+num2);
    printf("%d - %d = %d\n", num1 , num2, num1-num2);
    printf("%d * %d = %d\n", num1, num2, num1*num2);
    printf("%d / %d = %d\n", num1, num2, num1/num2);
    return 0;
}

অথবা

#include <iostream>

using namespace std;
int main ()
{
    int num1, num2;

    cout <<"Enter a number = "<<endl;
    cin>>num1;
    cout <<"enter another number = "<<endl;
    cin>>num2;
    cout << num1 <<" + "<< num2 <<" = "<< num1+num2 << endl;
    cout << num1 <<" - "<< num2 <<" = "<< num1-num2 << endl;
    cout << num1 <<" * "<< num2 <<" = "<< num1*num2 << endl;
    cout << num1 <<" / "<< num2 <<" = "<< num1/num2 << endl;
    return 0;
}

Edit:Fixed

permanent link

answered 05 Nov, 00:18

Grinch's gravatar image

Grinch
315

edited 06 Nov, 01:55

ভাই, "%d" টিকে বাদ দিয়ে কনভার্ট করা যায় না?

(05 Nov, 17:14) Sanan

অবশ্যই যায়।

....................................
cout << num1 << " / " << num2 << " = " << num1/num2 << endl;
...................................

দ্বিতীয় কোডটিতে @Grinch ভাই কিছু গণ্ডগোল করে ফেলেছে আরকি।

(05 Nov, 19:23) Mosharraf Hosain ♦

আমি নোটিসই করিনি.thanks

(06 Nov, 01:46) Grinch
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×395
×121

question asked: 04 Nov, 22:13

question was seen: 72 times

last updated: 06 Nov, 01:55