Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ typedef struct complex_t {
* By [Annarose K](https://github.com/AnnaroseK/SFID-255976complex_calculator)
* By [Jeevak Raj](https://github.com/JeevakRaj/LTTS_Stepin_Exercises/tree/main/Question_1a_Complex_Calculator)
* By [Vivek Valagadri](https://github.com/vivekvalagadri/Stepin.git)
* By [260735-Vaibhav Gaur](https://github.com/VaibhavGaur56789/MiniProject_Template/tree/master/Example_Programs/programming_concpets/calculator_complex)
31 changes: 25 additions & 6 deletions Example_Programs/programming_concpets/calculator_complex/main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
#include <stdio.h>
#include "complex_calculator.h"
int main()
{
//TODO Write all the logic for Calculator app
printf("Complex calculator ");
#include "stdio.h"
#include "conio.h"
#include "inc\complex_calculator.h"

int main(){
complex_t a = {1, 1}, b = {3, 1}, c = {0, 0};

complex_sumcd(&a, &b, &c);
printf("%f %f\n\n", c.real, c.imaginary);

c.real = 0.0;
c.imaginary = 0.0;
complexSub(&a, &b, &c);
printf("%f %f\n\n", c.real, c.imaginary);

c.real = 0.0;
c.imaginary = 0.0;
complexMul(&a, &b, &c);
printf("%f %f\n\n", c.real, c.imaginary);

c.real = 0.0;
c.imaginary = 0.0;
complexDiv(&a, &b, &c);
printf("%f %f\n\n", c.real, c.imaginary);
return 0;
}