answersLogoWhite

0


Best Answer

Yes because even if you didn't get an A you tried you best.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is a b in int 1 maths good?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

What Grade do you need to get a B in Maths Int 2 Exam?

555


Write a program to divide 2 numbers without using the division operator?

int divide1(int a,int b) { int t=1; while(b*t<=a) { t++; } return t-1; }


Give an example to show that if A union B and A intersection B be given then A and B may not be uniquely determined?

The set A union B can be decomposed into three disjoint sub sets A\ (A int B), B\(A int B), and (A int B). So in this case (A union B) and (A int B) are fixed but "moving" elelments from A\ (A int B) into B\(A int B) will not affect (A union B) and (A int B). You should be able to fill in the details now.


Q5 Write a program to implement a calculator to perform all the four basic arithmetic operations on integers?

#include <stdlib.h> #include <stdio.h> #include <conio.h> int sum(int, int); int sub(int, int); int mul(int, int); int div1(int, int); int main() { int a,b,d; int ch; printf("\t\tCalculator Implementation\n"); printf("\t\t~\n"); printf("\t\t 1: Add\n"); printf("\t\t 2: Sub\n"); printf("\t\t 3: Multiply\n"); printf("\t\t 4: Divide\n"); printf("\t\t 5: Exit\n\n\n"); printf("\t\t Enter the choice: "); scanf("%d", &ch); if(ch==5) exit(0); printf("\nEnter first number: "); scanf("%d", &a); printf("\nEnter Second number: "); scanf("%d", &b); printf("\na = %d; b = %d;\n", a, b); printf("==============\n\n"); switch(ch) { case 1 : d=sum(a,b); printf("Sum %d + %d = %d",a,b,d); break; case 2: d=sub(a,b); printf("Subtraction %d - %d = %d",a,b,d); break; case 3: d=mul(a,b); printf("Multiplication %d * %d = %d",a,b,d); break; case 4 : d=div1(a,b); printf("Division %d / %d = %d",a,b,d); break; default: printf("Invalid Choice!"); getch(); } getch(); return 0; } int sum(int a, int b) { return a + b; } int sub(int a, int b) { return a - b; } int mul(int a, int b) { return a * b; } int div1(int a, int b) { return a / b; }


C program to print all combinations of a 4-digit number?

#include<stdio.h> int main() { int a,b,c,d; for(a=1; a<5; a++) { for(b=1; b<5; b++) { for(c=1; c<5; c++) { for(d=1; d<5; d++) { if(!(a==b a==c a==d b==c b==d c==d)) printf("dd\n",a,b,c,d); } } } } return 0; }

Related questions

What Grade do you need to get a B in Maths Int 2 Exam?

555


How do you add two numbers in c language?

int a = 1 + 2; ---------- int a = 1; int b = 2; a += b;


How do you find the GCD?

int gcd (int a, int b) { if (a<0) a= -a; if (b<0) b= -b; while (a!=0 && b!=0 && a!=1 && b!=1) { int tmp; if (a>b) tmp= b, b= a, a= tmp; a= a%b; } if (a==0) return b; else if (b==0) return a; else return 1; }


Recursive program for a power b in c language?

int pow (int a, int b) { if (b==0) return 1; else return a*pow(a,b-1); }


Given 2 int arrays a and b each length 3 return a new array length 2 containing their middle elements?

Java solutionpublic static final int[] getMiddle(final int[] a, final int[] b) {return new int[] {a[1], b[1]};}C solution void getMiddle(const int a[], const int b[], int ret[]) {ret[0] = a[1];ret[1] = b[1];}


Give all the programs written in java regarding swapping of values?

// Swapping values of a and b int a = 1; int b = 50; int temp = a; // temp = 1 a = b; // a = 50 b = temp; // b = 1


Program to find a raised to the power b by using recursion in java?

//with a function: int exponent(int a, int b){ int returnValue; if (x==0) return 1; else return(a*exponent(a,x-1)); } main(){ printf("%d\n", exponent(1, 1)); }


How do you input two numbers not using operation by multiplication by using addition?

I suppose you wanted to ask: how to do multiplication with repeated addition. int mul (int a, int b) { int sum= 0; int sign= 1; if (b<0) { sign= -1; b= -b;} for (; b; --b) sum = sum + a; return sign*sum; }


Programme for sum of two integers using C?

int a = 1; int b = 2; int c = a + b; // Sum


How do you subtract improper fraction in C programming language?

The following shows how this can be achieved: typedef struct fraction { int n; // numerator int d; // denominator }; struct fraction subtract (struct fraction a, struct fraction b) { struct fraction r; // result r.d = lcm (a.d, b.d); // lowest common multiple r.n = (a.n * (r.d/a.d)) - (b.n * (r.d/b.d)); return r; } The lcm() function has the following definition: int lcm (int a, int b) { int sign = 1; if (a<0) a*=-1, sign *=(-1); if (b<0) b*=-1, sign *=(-1); return (a*b) / gcd (a,b) * sign; } The gcd() function (greatest common divisor) has the following definition: int gcd (int a, int b) { int sign = 1; if (a<0) a*=-1, sign *=(-1); if (b<0) b*=-1, sign *=(-1); while (a!=b) a>b?a-=b:b-=a; return a * sign; }


How do you write the programme that display truth table of AND gate by using C or C plus plus programming language?

#include <iostream> int main (void) { std::cout << "\nBitwise AND (&):\n"; for (int a=0; a<=1; ++a) for (int b=0; b<=1; ++b) std::cout << a << " & " << b << " is " << a & b << std::endl; std::cout << "\nLogical AND (&&):\n"; for (int a=0; a<=1; ++a) for (int b=0; b<=1; ++b) std::cout << a << " && " << b << " is " << a && b << std::endl; return 0; }


Swapping without third variable?

There are two ways in which you can swap without a third variable. 1. Using xor operation swap( int *a, int *b) { *a = *a ^ *b; *b = *a ^ *b; *a = *a ^ *b; } 2. Using addition and subtraction swap( int *a, int *b) { *a = *a + *b; *b = *a - *b; *a = *a - *b; } }