╱╱┏╮
╱╱┃┃
▉━╯┗━╮
▉┈┈┈┈┃
▉╮┈┈┈┃
╱╰━━━╯
I hope you like it
╱╱┃┃
▉━╯┗━╮
▉┈┈┈┈┃
▉╮┈┈┈┃
╱╰━━━╯
I hope you like it
👍4
// Series answer
#include <stdio.h>
#include <math.h>
int main() {
float ans = 1.0, temp = 1.0, x = 2.0;
int iterations = 3;
for (int i = 1; i <= iterations; i++) {
temp = temp * x / i;
ans += temp;
}
printf("Result from series expansion: %f\n", ans);
float expResult = exp(x);
printf("Result from inbuilt function (exp()): %f\n", expResult);
if (fabs(ans - expResult) < 0.0001) {
printf("The results match.\n");
} else {
printf("The results do not match.\n");
}
return 0;
}
// @C_code5
// Computer related numerical techniques
#include <stdio.h>
#include <math.h>
int main() {
float ans = 1.0, temp = 1.0, x = 2.0;
int iterations = 3;
for (int i = 1; i <= iterations; i++) {
temp = temp * x / i;
ans += temp;
}
printf("Result from series expansion: %f\n", ans);
float expResult = exp(x);
printf("Result from inbuilt function (exp()): %f\n", expResult);
if (fabs(ans - expResult) < 0.0001) {
printf("The results match.\n");
} else {
printf("The results do not match.\n");
}
return 0;
}
// @C_code5
// Computer related numerical techniques
// Decimal to binary conversion with steps
#include <stdio.h>
void integer(int intgr) {
if (intgr < 1)
return;
printf("Now dividing decimal by 2:\n");
char temp[32];
int index = 0;
while (intgr > 0) {
printf("%d / 2 reminder %d\n", intgr, intgr % 2);
temp[index++] = intgr % 2 + '0';
intgr = intgr / 2;
}
printf("\nBinary is ");
for (int i = index - 1; i >= 0; i--) {
printf("%c", temp[i]);
}
printf("\n");
}
int main() {
int dcml;
printf("Enter decimal number: ");
scanf("%d", &dcml);
int intgr = (int)dcml;
printf("Given decimal %d\n\n", dcml);
integer(intgr);
return 0;
}
#include <stdio.h>
void integer(int intgr) {
if (intgr < 1)
return;
printf("Now dividing decimal by 2:\n");
char temp[32];
int index = 0;
while (intgr > 0) {
printf("%d / 2 reminder %d\n", intgr, intgr % 2);
temp[index++] = intgr % 2 + '0';
intgr = intgr / 2;
}
printf("\nBinary is ");
for (int i = index - 1; i >= 0; i--) {
printf("%c", temp[i]);
}
printf("\n");
}
int main() {
int dcml;
printf("Enter decimal number: ");
scanf("%d", &dcml);
int intgr = (int)dcml;
printf("Given decimal %d\n\n", dcml);
integer(intgr);
return 0;
}
//performs different operations on two numbers...
#include<stdio.h>
int add(int k,int l) {
return k+l;
}
int sub(int k,int l) {
return k-l;
}
int multi(int k,int l) {
return k*l;
}
float div(int k,int l) {
return k/(float)l;
}
int main() {
int a,b;
char Op;
printf("Enter first number: ");
scanf("%d",&a);
printf("Enter second number: ");
scanf("%d",&b);
printf("Enter Operator: ");
scanf(" %c",&Op);
switch(Op) {
case'+':
printf("Addition of two numbers: %d",add(a,b));
break;
case'-':
printf("Subtraction of two numbers: %d",sub(a,b));
break;
case'*':
printf("Multiplication of two numbers: %d",multi(a,b));
break;
case'/':
if(b==0)
printf("Division by zero not possible");
else
printf("Division of two numbers: %.3f",div(a,b));
break;
default:
printf("Error!Enter correct operator");
}
return 0;
}
#include<stdio.h>
int add(int k,int l) {
return k+l;
}
int sub(int k,int l) {
return k-l;
}
int multi(int k,int l) {
return k*l;
}
float div(int k,int l) {
return k/(float)l;
}
int main() {
int a,b;
char Op;
printf("Enter first number: ");
scanf("%d",&a);
printf("Enter second number: ");
scanf("%d",&b);
printf("Enter Operator: ");
scanf(" %c",&Op);
switch(Op) {
case'+':
printf("Addition of two numbers: %d",add(a,b));
break;
case'-':
printf("Subtraction of two numbers: %d",sub(a,b));
break;
case'*':
printf("Multiplication of two numbers: %d",multi(a,b));
break;
case'/':
if(b==0)
printf("Division by zero not possible");
else
printf("Division of two numbers: %.3f",div(a,b));
break;
default:
printf("Error!Enter correct operator");
}
return 0;
}
👍3
//Addition of two Matrices..
#include <stdio.h>
int main() {
int row, column;
printf("Enter the number of rows and columns: ");
scanf("%d %d", &row, &column);
if (row <= 0 || column <= 0) {
printf("Error: Row and column values must be positive integers.\n");
return 1;
}
int a[row][column], b[row][column];
printf("\nEnter values for matrix A:\n");
for (int r = 0; r < row; r++) {
for (int c = 0; c < column; c++) {
printf("Enter row %d and column %d: ", r, c);
scanf("%d", &a[r][c]);
}
}
printf("\nEnter values for matrix B:\n");
for (int r = 0; r < row; r++) {
for (int c = 0; c < column; c++) {
printf("Enter row %d and column %d: ", r, c);
scanf("%d", &b[r][c]);
}
}
printf("\nMatrix A:\n");
for (int r = 0; r < row; r++) {
for (int c = 0; c < column; c++) {
printf("%d ", a[r][c]);
}
printf("\n");
}
printf("\nMatrix B:\n");
for (int r = 0; r < row; r++) {
for (int c = 0; c < column; c++) {
printf("%d ", b[r][c]);
}
printf("\n");
}
printf("\nSum of Matrix A and Matrix B:\n");
for (int r = 0; r < row; r++) {
for (int c = 0; c < column; c++) {
printf("%d ", a[r][c] + b[r][c]);
}
printf("\n");
}
return 0;
}
#include <stdio.h>
int main() {
int row, column;
printf("Enter the number of rows and columns: ");
scanf("%d %d", &row, &column);
if (row <= 0 || column <= 0) {
printf("Error: Row and column values must be positive integers.\n");
return 1;
}
int a[row][column], b[row][column];
printf("\nEnter values for matrix A:\n");
for (int r = 0; r < row; r++) {
for (int c = 0; c < column; c++) {
printf("Enter row %d and column %d: ", r, c);
scanf("%d", &a[r][c]);
}
}
printf("\nEnter values for matrix B:\n");
for (int r = 0; r < row; r++) {
for (int c = 0; c < column; c++) {
printf("Enter row %d and column %d: ", r, c);
scanf("%d", &b[r][c]);
}
}
printf("\nMatrix A:\n");
for (int r = 0; r < row; r++) {
for (int c = 0; c < column; c++) {
printf("%d ", a[r][c]);
}
printf("\n");
}
printf("\nMatrix B:\n");
for (int r = 0; r < row; r++) {
for (int c = 0; c < column; c++) {
printf("%d ", b[r][c]);
}
printf("\n");
}
printf("\nSum of Matrix A and Matrix B:\n");
for (int r = 0; r < row; r++) {
for (int c = 0; c < column; c++) {
printf("%d ", a[r][c] + b[r][c]);
}
printf("\n");
}
return 0;
}
❤3
//Transpose of Matrix..
#include<stdio.h>
int main() {
int row, column;
printf("Enter row and column of Matrix:");
scanf("%d %d",&row,&column);
if (row <= 0 || column <= 0) {
printf("Error!! Row and column values must be positive integers.\n");
return 1;
}
int a[row][column];
for(int r=0; r<row; r++) {
for(int c=0; c<column; c++) {
printf("Enter element A[%d%d] :",r,c);
scanf("%d",&a[r][c]);
}
}
printf("\nMatrix:\n");
for(int r=0; r<row; r++) {
for(int c=0; c<column; c++) {
printf("%d ",a[r][c]);
}
printf("\n");
}
printf("\nTranspose of Matrix:\n");
for(int r=0; r<column; r++) {
for(int c=0; c<row; c++) {
printf("%d ",a[c][r]);
}
printf("\n");
}
return 0;
}
#include<stdio.h>
int main() {
int row, column;
printf("Enter row and column of Matrix:");
scanf("%d %d",&row,&column);
if (row <= 0 || column <= 0) {
printf("Error!! Row and column values must be positive integers.\n");
return 1;
}
int a[row][column];
for(int r=0; r<row; r++) {
for(int c=0; c<column; c++) {
printf("Enter element A[%d%d] :",r,c);
scanf("%d",&a[r][c]);
}
}
printf("\nMatrix:\n");
for(int r=0; r<row; r++) {
for(int c=0; c<column; c++) {
printf("%d ",a[r][c]);
}
printf("\n");
}
printf("\nTranspose of Matrix:\n");
for(int r=0; r<column; r++) {
for(int c=0; c<row; c++) {
printf("%d ",a[c][r]);
}
printf("\n");
}
return 0;
}
//Fibonacci sequence and Factorial by using recursion..
#include <stdio.h>
int fibo(int a) {
if(a==0)
return 0;
else if(a==1||a==2)
return 1;
else return fibo(a-1)+fibo(a-2);
}
void printFiboSeries(int n, int f) {
if (f < n) {
printf("%d ",fibo(f));
printFiboSeries(n, f + 1);
}
}
int fact(int b) {
if(b==0)
return 1;
else
return (b*fact(b-1));
}
int main() {
int n,f;
printf("Enter the terms:");
scanf("%d",&n);
printf("Fibonacci sequence:");
printFiboSeries(n,0);
printf("\nFactorial of given number:%d",fact(n));
return 0;
}
#include <stdio.h>
int fibo(int a) {
if(a==0)
return 0;
else if(a==1||a==2)
return 1;
else return fibo(a-1)+fibo(a-2);
}
void printFiboSeries(int n, int f) {
if (f < n) {
printf("%d ",fibo(f));
printFiboSeries(n, f + 1);
}
}
int fact(int b) {
if(b==0)
return 1;
else
return (b*fact(b-1));
}
int main() {
int n,f;
printf("Enter the terms:");
scanf("%d",&n);
printf("Fibonacci sequence:");
printFiboSeries(n,0);
printf("\nFactorial of given number:%d",fact(n));
return 0;
}
//LCM and HCF
#include<stdio.h>
int main() {
int a, b, i, hcf=1,max;
printf("Enter first number:");
scanf("%d",&a);
printf("Enter second number:");
scanf("%d",&b);
for(i = 1; i <= a || i <= b; i++) {
if( a%i == 0 && b%i == 0 )
hcf = i;
}
max=(a>b)?a:b;
while(1) {
if(max%a==0 && max%b==0) {
break;
}
max++;
}
printf("LCM = %d\n",max);
printf("HCF = %d", hcf);
return 0;
}
#include<stdio.h>
int main() {
int a, b, i, hcf=1,max;
printf("Enter first number:");
scanf("%d",&a);
printf("Enter second number:");
scanf("%d",&b);
for(i = 1; i <= a || i <= b; i++) {
if( a%i == 0 && b%i == 0 )
hcf = i;
}
max=(a>b)?a:b;
while(1) {
if(max%a==0 && max%b==0) {
break;
}
max++;
}
printf("LCM = %d\n",max);
printf("HCF = %d", hcf);
return 0;
}
C language for beginners : https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb-QnlQrjsuDuhpXX1G
Regular videos: continue with me till full c language
Regular videos: continue with me till full c language
C language basics
https://youtu.be/aQU4litGb-c
https://youtu.be/aQU4litGb-c
YouTube
C programming language for beginners in hindi || c introduction by Siddharth Sharma
C programming language for beginners in hindi || c introduction by Siddharth Sharma
install vs code and mingw compiler:
https://youtu.be/ddxqPCVaAmY
Full Playlist:
C language for beginners: https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb-QnlQrjsuDuhpXX1G…
install vs code and mingw compiler:
https://youtu.be/ddxqPCVaAmY
Full Playlist:
C language for beginners: https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb-QnlQrjsuDuhpXX1G…
Comments in c language and Plateforms to run c codes
https://youtu.be/UaN-OaDCx8Q?si=kz5tfAwQKQJpi7Aw
https://youtu.be/UaN-OaDCx8Q?si=kz5tfAwQKQJpi7Aw
YouTube
Comments in c language || Plateforms for running c language || where I can run c code part 2
Comments in c language || Plateforms for running c language || where I can run c code part 2 by Siddharth Sharma
install vs code and mingw compiler:
https://youtu.be/ddxqPCVaAmY
Full Playlist:
C language for beginners: https://www.youtube.com/playlis…
install vs code and mingw compiler:
https://youtu.be/ddxqPCVaAmY
Full Playlist:
C language for beginners: https://www.youtube.com/playlis…
Variables and constants in C language for absolute beginners
https://youtu.be/GPat5ENZytg?si=h9vm8GpHHfONEu24
https://youtu.be/GPat5ENZytg?si=h9vm8GpHHfONEu24
YouTube
Variables and constants in c language || C programming by Siddharth Sharma #part6
Variables and constants in c language || C programming by Siddharth Sharma #part6
install vs code and mingw compiler:
https://youtu.be/ddxqPCVaAmY
Full Playlist:
C language for beginners: https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb-QnlQrjsuDuhpXX1G…
install vs code and mingw compiler:
https://youtu.be/ddxqPCVaAmY
Full Playlist:
C language for beginners: https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb-QnlQrjsuDuhpXX1G…
How to run c code manually without and with vs code in any os
https://youtu.be/22kOt_PLpGs?si=kO2_xiFxFOREsmXo
https://youtu.be/22kOt_PLpGs?si=kO2_xiFxFOREsmXo
YouTube
how to run manually c code by command | without vs code run c codes || c language tutorial #part7
how to run manually c code by command | without vs code run c codes || c language tutorial #part7
install vs code and mingw compiler:
https://youtu.be/ddxqPCVaAmY
Full Playlist:
C language for beginners: https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb…
install vs code and mingw compiler:
https://youtu.be/ddxqPCVaAmY
Full Playlist:
C language for beginners: https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb…
Expressions and operators in c detailed
Topics covered:
00: 00 introduction to c operaters
02: 00 All c language operators in detail practically explained
02: 03 Airthmetic operators in c
03: 33 Relational operators in c
05: 07 Logical operators in c
06: 50 Assignment operators or shortcuts in c
09: 00 increment decrement operators in c
09: 41 sizeof and ternary operator in c
10: 59 comma operator in c
11: 44 bitwise operator, address of, pointer dereference, member access operators
12: 23 expressions in c language
https://youtu.be/qerhr7-a9TM?si=4v1uf0S6Nxep_pHA
Topics covered:
00: 00 introduction to c operaters
02: 00 All c language operators in detail practically explained
02: 03 Airthmetic operators in c
03: 33 Relational operators in c
05: 07 Logical operators in c
06: 50 Assignment operators or shortcuts in c
09: 00 increment decrement operators in c
09: 41 sizeof and ternary operator in c
10: 59 comma operator in c
11: 44 bitwise operator, address of, pointer dereference, member access operators
12: 23 expressions in c language
https://youtu.be/qerhr7-a9TM?si=4v1uf0S6Nxep_pHA
YouTube
Operators and expressions in c || C operators by Siddharth Sharma #part8
Operaters and expressions in c language || c Operaters by Siddharth Sharma #part8
install vs code and mingw compiler:
https://youtu.be/ddxqPCVaAmY
Full Playlist:
C language for beginners: https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb-QnlQrjsuDuhpXX1G…
install vs code and mingw compiler:
https://youtu.be/ddxqPCVaAmY
Full Playlist:
C language for beginners: https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb-QnlQrjsuDuhpXX1G…
👍2
( MCS-011 ) C language me backshlash character kya hote hain #Part11
https://youtu.be/PjET6HrGyok
Full Playlist: Click Here
https://youtu.be/PjET6HrGyok
Full Playlist: Click Here
YouTube
c language me backshlash character kya hote hain || escape sequence in c by sid #part11
c language me backshlash character kya hote hain || text ko c me Newline me kaise print kare #part11
Full Playlist:
C language for beginners: https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb-QnlQrjsuDuhpXX1G
keys:
escape sequence in c,execution character…
Full Playlist:
C language for beginners: https://www.youtube.com/playlist?list=PLjEYzWkdEvxv5Byb-QnlQrjsuDuhpXX1G
keys:
escape sequence in c,execution character…
👍1
#include <stdio.h>
int main() {
int num1, num2, sum;
printf("Enter first number: ");
scanf("%d", &num1);
printf("Enter second number: ");
scanf("%d", &num2);
sum = num1 + num2;
printf("Sum of %d and %d is %d\n", num1, num2, sum);
return 0;
}
/* * * * * * * * * * * * * * * * * * * *
How to take user input:
https://youtu.be/VbaKf9FwnDk
Video have a task
* * * * * * * * * * * * * * * * * * * */
int main() {
int num1, num2, sum;
printf("Enter first number: ");
scanf("%d", &num1);
printf("Enter second number: ");
scanf("%d", &num2);
sum = num1 + num2;
printf("Sum of %d and %d is %d\n", num1, num2, sum);
return 0;
}
/* * * * * * * * * * * * * * * * * * * *
How to take user input:
https://youtu.be/VbaKf9FwnDk
Video have a task
* * * * * * * * * * * * * * * * * * * */
👍3
// 1 to 100 numbers
#include <stdio.h>
int main() {
for (int i = 1; i <= 10; i++) {
for (int j = 0; j < 10; j++)
if(i < 10)
printf("%d%d ", j, i);
else
printf("%d ", (j + 1) * 10);
printf("\n");
}
return 0;
}
#include <stdio.h>
int main() {
for (int i = 1; i <= 10; i++) {
for (int j = 0; j < 10; j++)
if(i < 10)
printf("%d%d ", j, i);
else
printf("%d ", (j + 1) * 10);
printf("\n");
}
return 0;
}
👍2