Write a function to add, subtract, multiply, and divide two complex numbers (x +iy) and (c + id). in C typedef struct {double real;double imaginary;} Complex; Complex addComplex(Complex a, Complex b) {Complex result;result.real = a.real + b.real;result.imaginary = a.imaginary + b.imaginary;return result;} Complex subtractComplex(Complex a, Complex b) {Complex result;result.real = a.real – b.real;result.imaginary = a.imaginary...
Category: C Programming
write a program in c to generate the following matrics: A = [ 3 5 7 2 −3 4 4 5 2 ] , B = [ 7 6 6 −5 4 3 ]
void displayMatrix(int matrix[][3], int rows, int columns) {for (int i = 0; i < rows; i++) {for (int j = 0; j < columns; j++) {printf(“%d “, matrix[i][j]);}printf(“n”);}} int main() {int A[3][3] = {{3, 5, 7},{2, -3, 4},{4, 5, 2}}; }
Write a program that uses a “for” loop to compute and prints the sum of a givennumbers of squares.
Write a program that uses a “for” loop to compute and prints the sum of a givennumbers of squares. #include<stdio.h> int main() {int n;int sum_of_squares = 0; }
Write a program for the interest charged in installments for the following case. A cassette player costs Rs. 2000. A shopkeeper sells it for Rs. 100 down payment and Rs. 100 for 21 more months. What is the monthly interest charged?
Write a program for the interest charged in installments for following case. A cassetteplayer costs Rs. 2000. A shopkeeper sells it for Rs. 100 down payment and Rs. 100for 21 more months. What is the monthly interest charged? principal = 2000 # Principal amount (cost of the cassette player)down_payment = 100 # Down payment made...
Find the value of “a” in each of the following statements:int i=3 , j=4 ,k=8float a=4.5 ,b=6.5,c=3.5
Let’s calculate the value of “a” for each of the given statements: (a) a = b – i/k + c/kSubstituting the given values:a = 6.5 – 3 / 8 + 3.5a = 6.5 – 0.375 + 3.5a = 6.125 + 3.5a = 9.625 (b) a = (b – k) / j + (j + c)...
BSc.CSIT C Programming 1st Semester Old Questions
B.Sc. CSIT 1st Semester Old Questions Subject : C – Programming C-Programming Year: 2065 Old Question Attempt all questions: A = [3 5 72 −3 44 5 2] , B = [7 66 −54 3] OR Why do you require a graphical function? Explain the basic graphical function with suitable program. Bsc. CSIT C- Programming...

