Posts

Matrix Multiplication ❌

Image
Matrix Multiplication ❌ |a b| |c d| multiply |w x| |y z| = |(aw+by)(ax+bz)| |(cw+dy)(cx+dz)| ——————————— |a b| |c d| multiply |w| |y | = |(aw+by)| |(cw+dy)|  ——————————— |a b e| |c d f| |g h i| multiply |w x t| |y z u| |k m n| × |(aw+by+ek)(ax+bz+em)(at+bu+en)| |(cw+dy+fk)(cx+dz+fm)(ct+du+fn)| |(gw+hy+ik)(gx+hz+im)(gt+hu+in)| ——————————— In picture format also,

C++ Friend Function

#include<iostream> using namespace std; //🙂First class with friend function class DF; class DM {     int m;     int cm; public:     void get();     void put();     friend void compare(DM,DF); }; //🙂Second class with friend function class DF {     int f;     int i; public:     void get();     void put();     friend void compare(DM,DF); }; //😊 First class input void DM::get() {     cout<<"Enter Meter:";     cin>>m;     cout<<"Enter Cemi:";     cin>>cm; } //😊 First class output void DM::put() {     cout<<"Meter="<<m;     cout<<"Cemi="<<cm; } //😊 Second class input void DF::get() {     cout<<"Enter feet:";     cin>>f;     cout<<"Enter Inch:";     cin>>i; } //😊 Second class output void DF::put() {     cout<<"Feet="<<f;     cout<<"Inch="<<i; } //They 😸are friends now. void compare(DM mm,DF ff) {     int te

Find Factorial Using Loop in C

javapoint.com #include <stdio.h>  int main()    {    /*i और num को declare कीजिए,और,fact को declare और initialise कीजिए*/ int i,fact=1,num;    //num variable में एक नंबर रखिए printf( "Enter a number: " );      scanf( "%d" ,&num); /* i variable को 1 से लेकर num तक दौड़ाइए,और, सभी को fact में रखके multiply कर दीजिए*/ //Example:num=4,i=1,2,3,4     for (i=1;i<=num;i++)     {        //fact=1*1×2×3×4       fact=fact*i;        }     //फ़िर,fact को प्रिंट करवा दीजिए   printf( "Factorial of %d is: %d" ,num,fact);    return 0;  }  /*Output:- Enter a number: 4 Factorial of 4 is: 24 [Process completed - press Enter]*/

Find Factor Of Any Number

#include<stdio.h> int main() {  //no को declare और f=1 को declare and initialise कीजिए  int no,f=1;  //no variable में एक नंबर रखिए  printf("Enter any number\n");  scanf("%d",&no);  printf("Factor is given below\n");  for(int i=1;i<=no;i++)  { /*जो i की value 1 से लेकर  no-variable तक no-variable को पूरी तरह काट दें,वो no variable का factor hoga.*/   if(no%i==0) //उसी i value को प्रिंट करवाइए   printf("%d ",i);  } } /*Enter any number 12 Factor is given below 1 2 3 4 6 12 [Process completed - press Enter]*/

Cute🥺-Maths🔢in C Language😎.

Example1:Cut a number into it's digit #include<stdio.h> void main() { //पहले n and m📢declare करो int n,m; //फ़िर,n variable में एक अंक डालो😌 printf("Enter a number:"); scanf("%d",&n); while(n!=0)   { //n mod(%) 10 से last digit☺️मिल जाता है m=n%10; //last digit छापिए🖨️ printf("%d\n",m); // n/10 अर्थात् 45/10=4.5=4,int data type के वज़ह से point के बाद वाला digit कट जाता है 🤣 n=n/10;   } } /*Enter a number:356 6 5 3 [Process completed (code 2) - press Enter]*/ Example2: Reverse the digit of a number. #include<stdio.h> void main() { //पहले n and m📢declare करो int n,m; //फ़िर,n variable में एक अंक डालो😌 printf("Enter a number:"); scanf("%d",&n); while(n!=0) { //n mod(%) 10 से last digit☺️मिल जाता है m=n%10; //last digit छापिए🖨️ printf("%d",m); // n/10 अर्थात् 45/10=4.5=4,int data type के वज़ह से point के बाद वाला digit कट जाता है 🤣 n=n/10; } } /*Enter a number:38392 29383 [Process completed (code 1

For Loop Best ☺️ Examples

Example1: #include<stdio.h> int main() {  //i को 1 से तक दौड़ा के प्रिंट करवाइए  for(int i=1;i<=10;i++)  {   printf("%d\n",i);  } } //या,ये लिखें i को अलग से int में declare करके #include<stdio.h>   int main() {   int i=0;         for(i=1;i<=10;i++){       printf("%d \n",i);       }      return 0;   }     /*Output:- 1 2 3 4 5 6 7 8 9 10 [Process completed - press Enter]*/ Example2: #include<stdio.h> int main() {  //no variable को int में declare करो  int no;  //जिसका table चाहिए,वो नंबर लिखो  printf("Enter any number\n");  scanf("%d",&no);  //For Loop के मदद से 1 से 10 तक i को दौड़ाइए  for(int i=1;i<=10;i++)  { //i को 1 से 10 की no variable से बारी बारी से multiply ❌ करके प्रिंट करवाइए   printf("%d ",i*no);  } } /*Enter any number 11 11 22 33 44 55 66 77 88 99 110 [Process completed - press Enter]*/ Example3: #include<stdio.h> int main() {  //no variable को declare कीजिए  int no; //no variable में एक

Arithmetic Operations in C

Example-1:- #include <stdio.h> void main() { //संख्या x,y को declare कीजिए   //sum को भी declare कीजिए जिसमे x+y को रखा जाएगा     int x,y,sum;     //x और y variables में नंबर रखिए     printf("Enter Two Integers : ");     scanf("%d%d",&x,&y);     //फ़िर,x और y को जोड़िए और sum के कक्ष में रखिए     sum=x+y;     //फ़िर,sum को print करवा लीजिए     printf("\nAddition = %d",sum); }  /*Enter Two Integers : 4 8 Addition = 12 [Process completed (code 14) - press Enter]*/ Example-2:- #include<stdio.h> void main() {  //int में करके📢declare a,b,c  int a,b,c;  //a variable के अंदर एक अंक🔢लिखता✍️हूं,  printf("Enter first number\n"); //फ़िर, सिस्टम scanf😌के मदद से a variable को पढ़ लेता है  scanf("%d",&a);  //b variable में भी दूजा अंक🔢रखता हूं,  printf("Enter second number\n");  //फ़िर, system वैसे ही दोबारा b variable पढ़ लेता है,  scanf("%d",&b); //बाद में,c की डोली🧺में a-b को बैठा कर,  c=a-b;  /