#26 C Struct | C Programming for Beginners

preview_player
Показать описание
#26 C Struct | C Programming for Beginners

In this video, we will learn about struct in C programming. More specifically, we will learn to store related data together under a single name using struct. And we will also learn the use of an alias. Watch out for this video to have a clear understanding of struct in C programming.

~
Resources:

Timestamps:
0:16 - C Struct
07:35 - typedef in Struct
08:50 - Sum of Complex Numbers
12:38 - Programming Task
13:17 - Quiz
~

Revise your learning using our C App

Find Programiz elsewhere:

#programiz #struct #cprogramming #learnprogramming #typedef #alias
Рекомендации по теме
Комментарии
Автор

🚀 Loved the tutorial? Take it further with Programiz PRO!
Refine your skills, conquer coding fears, and build confidence with interactive lessons, quizzes, and challenges. Strengthen your programming foundation and master C today!

programizstudios
Автор

Very basic tutorial but high-quality for beginner, expecting more videos for C language

Frank-muqy
Автор

you have helped many all around the world a lot! thank you so much!

tteokmember
Автор

Me watching this having my semester exam tommorow 💀💀😭😭

zindycangaming
Автор

Amaizing Thank I havew lab of programming tomorrow and is about this thank

swahifaabdijuma
Автор

I'm also learning c programming language. Your Program learn trick very amazing mam ❤️ Thank you so much love u mam ❤️❤️

questionbaba
Автор

I like when she says "let me sow you" instead of "show", it's just so cute

tasneembendhia
Автор

/*
Create a program to find the differences
between three complex numbers.

* Perform the subtraction between
complex numbers by subtracting the
real part of one complex number from
other complex numbers and same for
the imaginary part too.

*/

#include <stdio.h>

//Differences of Complex Numbers
typedef struct Complex{
double real;
double imagine;
}complex;

int main(){

complex c1 = {.real = 45.34, .imagine = 15};
complex c2 = {.real = 21.34, .imagine = 30};
complex c3 = {.real = 13.34, .imagine = 10.5};


complex sub;

sub.real = c1.real - c2.real - c3.real;
sub.imagine = c1.imagine - c2.imagine - c3.imagine;

printf("Result is %.2lf - %.2lfi", sub.real, sub.imagine);


return 0;
}

bryanbalantes
Автор

Thanks a lot for the video, but I have one question. 9:30 Why did we add "Complex" after the "typedef struct"? We did not use "Complex" anywhere in the last version of the code. And without using it, the program still works.

iremtaze
Автор

Hi Panoha, i'm from Peru (latinoamerica), your videos are amazing thank for it, that i help me a lots.

wilsonvaler
Автор

Quiz: What is the name of the variable of the following struct?

struct Test {
double testScore;
int testCount;
} firstTest;

a. testScore
b. struct
c. firstTest
d. Test

programizstudios
Автор

Thank you so much. Tnx for sharing your knowledge generously.

Farhadpeymani
Автор

i have one question what is the main use for struct as more variable can be take to do the work? Is it related to memory of operation check?

Abdullah-ungo
Автор

At the last in quiz answer will be....(c) firstTest 💥💥💥💥

questionbaba
Автор

Your video are crisp and easy to understand

avdeshsingh
Автор

#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#include <string.h>

typedef struct Complex {
int real;
int imagine;
} complex;
int main()
{
complex c1 = {.real = 10, .imagine = 20};
complex c2 = {.real = 5, .imagine = 15};
complex c3 = {.real = 25, .imagine = 30};

complex minus;

minus.real = c1.real - c2.real - c3.real;
minus.imagine = c1.imagine - c2.imagine - c3.imagine;

printf("Total is: %d and %di", minus.real, minus.imagine);
return 0;
}

OUTPUT:

Total is: -20 and -25i

jmarkyt
Автор

Mam I need more structure videos such as pointer to structure, self referencial structure and singly linked list please post these videos for me

TonyStark-vt
Автор

Mam, When will the searching and sorting video come out in this series?

Allyou_
Автор

Mam explain this program in the next vedio write a c program to read a sentence and count the number of pf words in the sentence

HamsalekhaHamsa-qq
Автор

#include <stdio.h>
typedef struct complex{
double real;
double imaginary;
} complex;
int main(){
complex c1={.real=23.26, .imaginary=15.56};
complex c2={.real=13.26, .imaginary=5.56};
complex subtract;
subtract.real=c1.real - c2.real;
- c2.imaginary;
printf("difference between c1 and c2 is %.2lf + %.2lfi", subtract.real, subtract.imaginary);
return 0;
}

prathikantamsaivarnith