#26 C Struct | C Programming for Beginners

  Рет қаралды 77,441

Programiz

Programiz

2 жыл бұрын

#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.pro/signup?utm_...
This video is a part of our C Programming video series: • #1: Getting Started wi...
~
Resources:
C Online Compiler: www.programiz.com/c-programmi...
Github File: github.com/programiz/c-youtub...
C (title) Tutorial (text-based tutorial): www.programiz.com/c-programmi...
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

Пікірлер: 83
@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
@Frank-mu6qy
@Frank-mu6qy Жыл бұрын
Very basic tutorial but high-quality for beginner,expecting more videos for C language
@ikechukwuunegbu7266
@ikechukwuunegbu7266 2 жыл бұрын
Great job. Thank you for this.
@Farhadpeymani
@Farhadpeymani Жыл бұрын
Thank you so much. Tnx for sharing your knowledge generously.
@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?
@bennarthurdesouza1624
@bennarthurdesouza1624 Жыл бұрын
Thanks for this explanation!
@avdeshsingh001
@avdeshsingh001 Жыл бұрын
Your video are crisp and easy to understand
@swahifaabdijuma2782
@swahifaabdijuma2782 8 ай бұрын
Amaizing Thank youuuuuuuuu I havew lab of programming tomorrow and is about this thank uuuuuuuuuuuuuuuuuuuuuuuuuuu
@imvierdo
@imvierdo 2 жыл бұрын
Big fan of your sites and videos 😜
@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?
@stormstylz3447
@stormstylz3447 8 ай бұрын
Thank you!
@ironmonkey1990
@ironmonkey1990 5 ай бұрын
very helpfull!
@user-iu3fd4is4e
@user-iu3fd4is4e Жыл бұрын
You are the best❤
@avdeshsingh001
@avdeshsingh001 Жыл бұрын
Thanks ma'am
@Jarawain_Kharpran
@Jarawain_Kharpran Жыл бұрын
ty
@ndyakuhakiwilberforce9675
@ndyakuhakiwilberforce9675 12 күн бұрын
Thanks
@All4you_
@All4you_ 2 жыл бұрын
Mam, When will the searching and sorting video come out in this series?
@wilsonvaler1717
@wilsonvaler1717 2 жыл бұрын
Hi Panoha, i'm from Peru (latinoamerica), your videos are amazing thank for it, that i help me a lots.
@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
@srinivaschilla9881
@srinivaschilla9881 Жыл бұрын
Maadam miruu thopp🔥💥
@muhammadshahriar4770
@muhammadshahriar4770 Жыл бұрын
What's her fb id & insta id?
@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?
@user-qc1rq2rk3l
@user-qc1rq2rk3l 6 ай бұрын
Mam I need more structure videos such as pointer to structure,self referencial structure and singly linked list please post these videos for me
@thiagaodavez5465
@thiagaodavez5465 Жыл бұрын
comment leaved
@seabasschukwu6988
@seabasschukwu6988 Жыл бұрын
@questionbaba
@questionbaba 2 жыл бұрын
At the last in quiz answer will be....(c) firstTest 💥💥💥💥
@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".
@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; }
@user-tb5yv7ee5o
@user-tb5yv7ee5o 10 ай бұрын
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
@mahisflow1165
@mahisflow1165 2 жыл бұрын
First test
@yogithabale
@yogithabale 27 күн бұрын
opt c , first test
@surekingu5719
@surekingu5719 7 ай бұрын
I try take string value in struct but not work...how to solve.?
@shaikhmuhammadbakhtawarahm7533
@shaikhmuhammadbakhtawarahm7533 2 жыл бұрын
first test
@keshavdixit08
@keshavdixit08 Жыл бұрын
answer : C
@sadewnivihidula5505
@sadewnivihidula5505 10 ай бұрын
firstTest
@oluwatomirhodes795
@oluwatomirhodes795 4 ай бұрын
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
@aderolearnsengineering
@aderolearnsengineering 10 ай бұрын
C. firstTest
@tanzimkhan4695
@tanzimkhan4695 8 ай бұрын
Your Laptop Spec. ?🤩🤩
@PraveenPraveen-us3rp
@PraveenPraveen-us3rp 10 ай бұрын
Option : test
@user-mk9oz2fn5c
@user-mk9oz2fn5c Ай бұрын
Answer is option c mam
@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
@vinaykumarvinaykumar2006
@vinaykumarvinaykumar2006 Жыл бұрын
My Answer is c
@imrannazari8642
@imrannazari8642 Жыл бұрын
c
@aritradey7189
@aritradey7189 Жыл бұрын
c.firstTest
@firdaussaliman9983
@firdaussaliman9983 27 күн бұрын
nice bro
@user-fo7cn4dn6e
@user-fo7cn4dn6e 4 ай бұрын
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;
@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; }
@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; }
@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; }
@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; }
@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; }
@Eileen-in-the-coding-maschine
@Eileen-in-the-coding-maschine 5 ай бұрын
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
@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; }
@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
@countrysideshowyaigrock4689
@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; }
@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; }
@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; }
@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;
@ashirafuSalum
@ashirafuSalum 7 ай бұрын
firstTest
@1NazareeM618
@1NazareeM618 Жыл бұрын
Thanks
@user-tt2yu8tc5r
@user-tt2yu8tc5r 4 ай бұрын
First test
#27: Enumerations(enums) in C |  C Programming for Beginners
8:05
Structs in C | What you Need to Know
24:39
Caleb Curry
Рет қаралды 9 М.
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 37 МЛН
CHOCKY MILK.. 🤣 #shorts
00:20
Savage Vlogs
Рет қаралды 10 МЛН
Running "Hello World!" in 10 FORBIDDEN Programming Languages
18:07
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,1 МЛН
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 193 М.
#29: C File Handling | C Programming for Beginners
11:45
Programiz
Рет қаралды 147 М.
struct Basics | C Programming Tutorial
24:44
Portfolio Courses
Рет қаралды 134 М.
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
How I would learn to code (If I could start over)
9:16
Jason Goodison
Рет қаралды 4,6 МЛН
why do void* pointers even exist?
8:17
Low Level Learning
Рет қаралды 344 М.
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН