Тёмный

#26 C Struct | C Programming for Beginners 

Programiz
Подписаться 165 тыс.
Просмотров 78 тыс.
50% 1

#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.
Sign Up to get 50% off with this link: app.programiz....
This video is a part of our C Programming video series: • #1: Getting Started wi...
~
Resources:
C Online Compiler: www.programiz....
Github File: github.com/pro...
C (title) Tutorial (text-based tutorial): www.programiz....
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
Download here for Android: bit.ly/3upaInx
Download here for iOS: apple.co/3EZLtNq
Find Programiz elsewhere:
Programiz pro: programiz.pro/
Website: www.programiz.com
Discord: / discord
Facebook: / programiz
Instagram: / _programiz
LinkedIn: / programiz
Twitter: / programiz
#programiz #struct #cprogramming #learnprogramming #typedef #alias

Опубликовано:

 

19 апр 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 84   
@programizstudios
@programizstudios 2 года назад
🔥Finding it Damn Hard to Understand C Programming? Learn to code-the right way-with interactive lessons, quizzes & challenges. Build a strong programming base; it's IMPORTANT! Try Programiz PRO for Free: bit.ly/master-c-programming
@AbhiramDeshpande-fe1vi
@AbhiramDeshpande-fe1vi Год назад
#include typedef struct complex {int real; int imaginary;} complex; int main() { complex c1 = {.real=12,.imaginary=9}; complex c2 = {.real=3,.imaginary=2}; complex c3 = {.real=7,.imaginary=8}; complex difference; difference.real= c1.real-c2.real-c3.real; difference.imaginary=c1.imaginary-c2.imaginary-c3.imaginary; printf("the sum is %d%di",difference.real,difference.imaginary); return 0; }
@tasneembendhia2675
@tasneembendhia2675 7 месяцев назад
I like when she says "let me sow you" instead of "show", it's just so cute
@jmarkyt5453
@jmarkyt5453 Год назад
#include #include #include #include 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
@tteokmember
@tteokmember Год назад
you have helped many all around the world a lot! thank you so much!
@muhammadshahriar4770
@muhammadshahriar4770 Год назад
What's her fb id & insta id?
@Frank-mu6qy
@Frank-mu6qy Год назад
Very basic tutorial but high-quality for beginner,expecting more videos for C language
@bryanbalantes6486
@bryanbalantes6486 Год назад
/* 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 //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; }
@swahifaabdijuma2782
@swahifaabdijuma2782 8 месяцев назад
Amaizing Thank youuuuuuuuu I havew lab of programming tomorrow and is about this thank uuuuuuuuuuuuuuuuuuuuuuuuuuu
@questionbaba
@questionbaba 2 года назад
I'm also learning c programming language. Your Program learn trick very amazing mam ❤️ Thank you so much love u mam ❤️❤️
@muhammadshahriar4770
@muhammadshahriar4770 Год назад
What's her fb id & insta id?
@questionbaba
@questionbaba 2 года назад
At the last in quiz answer will be....(c) firstTest 💥💥💥💥
@Farhadpeymani
@Farhadpeymani Год назад
Thank you so much. Tnx for sharing your knowledge generously.
@yogithabale
@yogithabale Месяц назад
opt c , first test
@ndyakuhakiwilberforce9675
@ndyakuhakiwilberforce9675 22 дня назад
Thanks
@Abdullah-un8go
@Abdullah-un8go 5 месяцев назад
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?
@ironmonkey1990
@ironmonkey1990 5 месяцев назад
very helpfull!
@avdeshsingh001
@avdeshsingh001 Год назад
Your video are crisp and easy to understand
@wilsonvaler1717
@wilsonvaler1717 2 года назад
Hi Panoha, i'm from Peru (latinoamerica), your videos are amazing thank for it, that i help me a lots.
@bennarthurdesouza1624
@bennarthurdesouza1624 Год назад
Thanks for this explanation!
@Whosumitmishraa
@Whosumitmishraa 2 года назад
Big fan of your sites and videos 😜
@ikechukwuunegbu7266
@ikechukwuunegbu7266 2 года назад
Great job. Thank you for this.
@srinivaschilla9881
@srinivaschilla9881 Год назад
Maadam miruu thopp🔥💥
@muhammadshahriar4770
@muhammadshahriar4770 Год назад
What's her fb id & insta id?
@user-mk9oz2fn5c
@user-mk9oz2fn5c 2 месяца назад
Answer is option c mam
@stormstylz3447
@stormstylz3447 9 месяцев назад
Thank you!
@prathikantamsaivarnith484
@prathikantamsaivarnith484 Год назад
#include 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; subtract.imaginary=c1.imaginary - c2.imaginary; printf("difference between c1 and c2 is %.2lf + %.2lfi",subtract.real,subtract.imaginary); return 0; }
@user-qc1rq2rk3l
@user-qc1rq2rk3l 7 месяцев назад
Mam I need more structure videos such as pointer to structure,self referencial structure and singly linked list please post these videos for me
@twinkleramchandani5193
@twinkleramchandani5193 5 дней назад
option d
@iremtaze6262
@iremtaze6262 Год назад
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.
@tylers6071
@tylers6071 11 месяцев назад
This is because she used "typedef" at the beginning of the definition. By doing so, she created an alias of "complex" which represents "struct Complex". So anywhere in the code that you see "complex" that is substituting for "struct Complex".
@avdeshsingh001
@avdeshsingh001 Год назад
Thanks ma'am
@user-tb5yv7ee5o
@user-tb5yv7ee5o 11 месяцев назад
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
@thiagaodavez5465
@thiagaodavez5465 Год назад
comment leaved
@user-iu3fd4is4e
@user-iu3fd4is4e Год назад
You are the best❤
@Jarawain_Kharpran
@Jarawain_Kharpran Год назад
ty
@user-tt2yu8tc5r
@user-tt2yu8tc5r 4 месяца назад
First test
@bbek300
@bbek300 3 месяца назад
#include typedef struct complex{ double real; double imaginary; }comp; int main() { comp c1 = { .real=41.5, .imaginary=20}; comp c2 = {.real=10.6, .imaginary=5}; comp c3 = {.real=15.2, .imaginary=2.3}; comp diff; diff.real=c1.real-c2.real-c3.real; diff.imaginary=c1.imaginary-c2.imaginary-c3.imaginary; printf("The Difference is %.2lf + %.2lfi",diff.real,diff.imaginary); return 0; }
@oluwatomirhodes795
@oluwatomirhodes795 5 месяцев назад
I am having problems with C progamming for engineers I am worried I will not do well on my finaly exam as I need 20%out of 40% to pass. That's what I am here. Seeking help. Please do you have a detailed video as to why you use the typedef and other methods of initializing struts. I don't mined I will pay for it
@programizstudios
@programizstudios 2 года назад
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
@rickzalman4136
@rickzalman4136 2 года назад
firstTest is the structure variable of type struct Test.
@ashutoshsharma2014
@ashutoshsharma2014 Год назад
first test
@igrow2785
@igrow2785 Год назад
a. testScore
@alokpatel7577
@alokpatel7577 Год назад
First test
@yadlaaravind811
@yadlaaravind811 Год назад
A
@surekingu5719
@surekingu5719 7 месяцев назад
I try take string value in struct but not work...how to solve.?
@user-to5rz4kc3i
@user-to5rz4kc3i 11 месяцев назад
#include typedef struct Complex { double real; double imagine; } complex; int main() { complex c1 = {.real = 3496.54, .imagine = 67.07}; complex c2 = {.real = 672.41, .imagine = 23.14}; complex c3 = {.real = 27.06, .imagine = 42.15}; complex subtraction; subtraction.real = c1.real - c2.real - c3.real; subtraction.imagine = c1.imagine - c2.imagine - c3.imagine; printf("Result is %.2lf + %.2lfi", subtraction.real, subtraction.imagine); return 0; }
@aderolearnsengineering
@aderolearnsengineering 10 месяцев назад
C. firstTest
@freehug071
@freehug071 Год назад
#include typedef struct complex{ double Real; double Imaginary; } complex; int main() { complex a1 = {.Real = 43.2, .Imaginary =23.32}; complex a2 = {.Real = 34.44, .Imaginary = 32.33}; complex sum; sum.Real = a1.Real - a2.Real; sum.Imaginary = a1.Imaginary - a2.Imaginary; printf("the Real of complex is %.1lf the Imaginary of complex is %.2lf ", sum.Real, sum.Imaginary); return 0; }
@All4you_
@All4you_ 2 года назад
Mam, When will the searching and sorting video come out in this series?
@user-fo7cn4dn6e
@user-fo7cn4dn6e 5 месяцев назад
typedef struct complexnum { int real, imag; } complexnum; int main() { int resultreal, resultimag; complexnum c1 = {.real = 8, .imag = 5 }; complexnum c2 = {.real = 6, .imag = 2 }; complexnum c3 = {.real = 3, .imag = 7 }; resultreal = c1.real - c2.real - c3.real; resultimag = c1.imag - c2.imag - c3.imag; printf("the result is: Z=%d%di ", resultreal, resultimag); return 0;
@keshavdixit08
@keshavdixit08 Год назад
answer : C
@PraveenPraveen-us3rp
@PraveenPraveen-us3rp 10 месяцев назад
Option : test
@tanzimkhan4695
@tanzimkhan4695 8 месяцев назад
Your Laptop Spec. ?🤩🤩
@shaikhmuhammadbakhtawarahm7533
@shaikhmuhammadbakhtawarahm7533 2 года назад
first test
@JASMIN-jg2vn
@JASMIN-jg2vn Месяц назад
#include typedef struct Complex { double real; double imagine; } complex; int main() { complex c1 = {.real = 144.8, .imagine = 188.4}; complex c2 = {.real = 84.6, .imagine = 68.55}; complex c3 = {.real = 48.9, .imagine = 24.6}; complex difference; difference.real = c1.real - c2.real - c3.real; difference.imagine = c1.imagine - c2.imagine - c3.imagine; printf("Result is %.2lf + %.2lfi", difference.real, difference.imagine); return 0; } output: Result is 11.30 + 95.25i
@seabasschukwu6988
@seabasschukwu6988 Год назад
@ashirafuSalum
@ashirafuSalum 8 месяцев назад
firstTest
@davebull6321
@davebull6321 Год назад
# include typedef struct Difference { double real; double imaginary; double answer; }difference; int main() { difference c1 = {.real = 34.14, .imaginary = 112.34}; difference c2 = {.real = 21.12, .imaginary = 80.21}; difference minus; minus.real = c1.real - c2.real; minus.imaginary = c1.imaginary - c2.imaginary; minus.answer = minus.imaginary - minus.real; printf("Result is %.2lf - %.2lf = %.2lf",minus.imaginary,minus.real,minus.answer); return 0; }
@vinaykumarvinaykumar2006
@vinaykumarvinaykumar2006 Год назад
My Answer is c
@aritradey7189
@aritradey7189 2 года назад
c.firstTest
@firdaussaliman9983
@firdaussaliman9983 Месяц назад
nice bro
@imrannazari8642
@imrannazari8642 Год назад
c
@onic9623
@onic9623 Год назад
Option C : firstTest --------------------------------------------------------------------------------- #include typedef struct complex { double real; double imagine; }complex; int main() { complex c1 = {.real = 23.56, .imagine = 47.2}; complex c2 = {.real = 11.28, .imagine = 25.7}; complex c3 = {.real = 9.38, .imagine = 14.4}; complex diff; diff.real = c1.real - c2.real - c3.real; diff.imagine = c1.imagine - c2.imagine - c3.imagine; printf("Difference is %.2lf - %.2lfi", diff.real, diff.imagine); return 0; }
@swabulabdul2393
@swabulabdul2393 Год назад
#include typedef struct Numbers{ double real; double imagine; }numbers; int main(){ numbers n1 = {.real = 600, .imagine = 300}; numbers n2 = {.real = 200, .imagine = 200}; numbers n3 = {.real = 100, .imagine = 100}; numbers diff; diff.real = n1.real - n2.real - n3.real; diff.imagine = n1.imagine - n2.imagine - n3.imagine; printf("The difference is: %.2lf + %.2lfi", diff.real, diff.imagine); return 0;
@Eileen-in-the-coding-maschine
@Eileen-in-the-coding-maschine 6 месяцев назад
Task: #include struct Complex { double real; double imagine; }; int main() { struct Complex complex1 = {.real = 35.56, .imagine = 45}; struct Complex complex2 = {.real = 45.76, .imagine = 75.67}; struct Complex complex3 = {.real = 105.86, .imagine = 146.98}; struct Complex sub; sub.real = complex3.real - complex2.real - complex1.real; sub.imagine = complex3.imagine - complex2.imagine - complex1.imagine; printf("Result: %.2lf + %.2lfi ", sub.real, sub.imagine); OUTPUT: Result: 24.54 + 26.31i Quiz: C is the correct option
@heevar6169
@heevar6169 Год назад
#include typedef struct Complex { double real; double imagine; }complex; int main(){ complex c1 = {.real = 11.12 , .imagine = 13.14}; complex c2 = {.real = 14.15 , .imagine = 15.16}; complex c3 = {.real = 16.17 , .imagine = 17.18}; complex sub; sub.real = (c1.real) - (c2.real) - (c3.real) ; sub.imagine = (c1.imagine) - (c2.imagine) - (c3.imagine) ; printf("%.2lf + %.2lfi ", sub.real , sub.imagine); return 0; }
@countrysideshowyaigrock4689
#include typedef struct Complex { double real; double imagine; } complex; int main() { complex c1 = {.real = 221.87, .imagine = 330}; complex c2 = {.real = 13.34, .imagine = 112.23}; complex c3 = {.real = 27.13, .imagine = 22.16}; 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; }
@user-jt3dx4zv3u
@user-jt3dx4zv3u Год назад
#include typedef struct Complex{ double real; double imaginary; } complex; int main(){ double imaginary; complex c1 = {.real =5, imaginary = 2}; complex c2 = {.real =2, imaginary = 4}; complex c3 = {.real =7, imaginary = 1}; complex sub1,sub2,sub3; sub1.real = c1.real - c2.real; sub2.real = c2.real - c3.real; sub3.real = c3.real - c1.real; sub1.imaginary = c1.imaginary -c2.imaginary; sub2.imaginary = c2.imaginary -c3.imaginary; sub3.imaginary = c3.imaginary -c1.imaginary; printf("c1- c2 is %.2lf + (%.2lfi) ", sub1.real ,sub1.imaginary); printf("c2- c3 is %.2lf + (%.2lfi) ", sub2.real ,sub2.imaginary); printf("c3- c1 is %.2lf + (%.2lfi)", sub3.real ,sub3.imaginary); return 0; }
@mahisflow1165
@mahisflow1165 2 года назад
First test
@sadewnivihidula5505
@sadewnivihidula5505 11 месяцев назад
firstTest
@1NazareeM618
@1NazareeM618 Год назад
Thanks
Далее
struct Basics | C Programming Tutorial
24:44
Просмотров 135 тыс.
Structs in C | What you Need to Know
24:39
Просмотров 9 тыс.
#29: C File Handling | C Programming for Beginners
11:45