Thursday 27 May 2021

C problems

 

//write a program to find largest number btw thw num
//author:upendra yadav date:10/29/2020
#include<stdio.h>
void main()
{
int num1,num2;
printf("Enter the two numbers to compare :\n");
scanf("%d%d",&num1,&num2);
if(num1>num2?num1:num2)
printf("greater number is %d",num2);
else
{

printf("greater number is %d",num1);


}



}

2.)

 #include <stdio.h>
#include <conio.h>

int main()
{
    /*
      Declaration of variables used
    */

    showframe(12,25);
    printf("\nPlayer 1, enter your name:");
     fgets(name[0], 30, stdin);
    printf("\nPlayer 2, enter your name:");
     fgets(name[1], 30, stdin);

    printf("\n%s, you take 0",name[0]);
    printf("\n%s, you take X",name[1]); getch();

    clrscr();

    do
    {
       while(!enter)
       {
         if(khbit())
          ch = getch();

           switch(ch)
           {
             case UPARROW : box = navigate(a[3][3], box, player, UPARROW);
             .
             .
             .
           }
       }
       if(quit) break;
       //check if the player wins
       win = checkforwin(a);

     }while(!win)

    if(win)
    { .
      .
    }

    else if(quit)
    {    .
         .
    }

 return 0;
}
}

3.)
  #include<stdio.h>
  void main()
  {
  float m;
  printf("Enter the value of m:\n");
  scanf("%f",&m);
  m/=10;
  printf("Answer is %f",m);
  }

4.)
#include<stdio.h>
void main()
{
int pin;
while(pin!=5135)
{
printf("Enter the Secret pin:");
scanf("%d",&pin);
if(pin!=5135)
printf("Enter Pin is Invalid\n");
else
{
printf("Enter Pin is correct");

}
}

}

5.)
/* write a program to withdrawal a amount
from the bank*/
#include<stdio.h>
void main()
{
char E,H,M;
printf("Press 'E' for English\n'H' for Hindi\n'M' for marathi\n");
scanf("%c%c%c",&E,&H,&M);



}

6.)
/*
 * C Program to Display the ATM Transaction
 */
#include <stdio.h>

unsigned long amount=1000, deposit, withdraw;
int choice, pin, k;
char transaction ='y';

void main()
{
    while (pin != 1520)
    {

        printf("ENTER YOUR SECRET PIN NUMBER:");
        scanf("%d", &pin);
        if (pin != 1520)
        printf("PLEASE ENTER VALID PASSWORD\n");


    }

    do
    {
        printf("********Welcome to ATM Service**************\n");
        printf("1. Check Balance\n");
        printf("2. Withdraw Cash\n");
        printf("3. Deposit Cash\n");
        printf("4. Quit\n");
        printf("******************?**************************?*\n\n");
        printf("Enter your choice: ");
        scanf("%d", &choice);
        switch (choice)
        {
        case 1:
            printf("\n YOUR BALANCE IN Rs : %lu ", amount);
            break;
        case 2:
            printf("\n ENTER THE AMOUNT TO WITHDRAW: ");
            scanf("%lu", &withdraw);
            if (withdraw % 100 != 0)
            {
                printf("\n PLEASE ENTER THE AMOUNT IN MULTIPLES OF 100");
            }
            else if (withdraw >(amount - 500))
            {
                printf("\n INSUFFICENT BALANCE");
            }
            else
            {
                amount = amount - withdraw;
                printf("\n\n PLEASE COLLECT CASH");
                printf("\n YOUR CURRENT BALANCE IS%lu", amount);
            }
            break;
        case 3:
            printf("\n ENTER THE AMOUNT TO DEPOSIT");
            scanf("%lu", &deposit);
                        amount = amount + deposit;
            printf("YOUR BALANCE IS %lu", amount);
            break;
        case 4:
            printf("\n THANK U USING ATM");
            break;
        default:
            printf("\n INVALID CHOICE");
        }
        printf("\n\n\n DO U WISH TO HAVE ANOTHER TRANSCATION?(y/n): \n");
        fflush(stdin);
        scanf("%c", &transaction);
        if (transaction == 'n'|| transaction == 'N')
                    k = 1;
    } while (!k);
    printf("\n\n THANKS FOR USING OUT ATM SERVICE");
}

7.)
#include<stdio.h>
void main()
{unsigned long amount=50000,deposit,withdraw;
 int choice,pin,k;
 char transaction='y';
 while(pin!=2408)
 {
     printf("Enter secret pin:");
     scanf("%d",&pin);
     if(pin!=2408)
        printf("Enter The Valid Pin");

 }
do
{
    printf("**************Welcome To HDFC Bank**************\n");
    printf("1.check Balance\t");
    printf("        2.withdrawal amount\n");
    printf("3.Deposit amount\t");
    printf("4.Quit\n");
    printf("************************************************\n");
    printf("Enter the choice\n");
    scanf("%d",&choice);
    switch(choice)
    {
    case 1:
        printf("Your Balance is Rs:%lu",amount);
        break;
    case 2:
        printf("Enter the Amount Withdraw:");
        scanf("%lu",&withdraw);
        if(withdraw%100!=0)
        {
            printf("\n Enter withdraw anount in multiple of 100");

        }
        else if(withdraw>(amount-1000))
               {

               printf("\n insufficient balance");
        }
        else
               {amount=amount-withdraw;

                printf("\n\n Please Collect Your cash");
                printf("\n Your current balance is %lu",amount);
            }
            break;
    case 3:
        printf("\nEnter the amount Deposit:");
        scanf("%lu",&deposit);
        amount=amount+deposit;
        printf("\nYour balance is %lu",amount);
        break;
    case 4:
        printf("\n Thanking Using ATM service");
        break;
    default:
        printf("\nInvalid choice");

    }
        printf("\n\n\nDo You Want Another Transaction('y or n')?\n");
        fflush(stdin);
        scanf("%c",&transaction);
        if(transaction=='n'||transaction=='N')
            k=2;
}
while(k>5);
    printf("\n Thankyou for using out your atm service ");

    }



8.)
//write a program to find big number
//author :upendra
#include<stdio.h>
void main()
{
int a,b,big;
printf("enter the two numbers:\n");
scanf("%d%d",&a,&b);
big=(a>b)?a:b;
printf("Big number is %d",big);









}
9.)
/*write a program to check birthday
boy name by putting input  of birth year*/
#include<stdio.h>
void main()
{
int year;
printf("Enter the year of a birth:\n");
scanf("%d",&year);
if(year==1971)
    printf("Happy Birthday Dad");
else{
    if(year==1975)
        printf("Happy Birthday Mom");
    else{
        if(year==1992)
            printf("Happy Birthday Bhupendra");
            else{
                if(year==1995)
                    printf("happy Birthday maya");
                else{
                    if(year==2000)
                    printf("Happy birthday Upendra");
                    else{
                        if(year==2005)
                            printf("Happy Birthday nitesh");
                        else
                            {
                                if(year==2009)
                                    printf("happy Birthday chhottu");
                                else
                                    printf("User Input is undefined");
                            }

                    }

                }
            }

    }
}
}

10.)
#include<stdio.h>
void main()
{
int n;
while(n<10)
{
printf("%d\n",n);
n++;
continue;
printf("This will not apper");
}

printf("\n this will appear");
}

C Programs Problems

 

#include<stdio.h>
void main()
{
char varchar;
varchar='A';
printf("%c",varchar);



}

2)
#include<stdio.h>
void main()
{
int a;
for(a=2;(a/2)>=0&&(a/2)<=100;a++)
printf("%d\n",a);}

3)
#include<stdio.h>
void main()
{
int i,j;
for(i=1;i<=10;i++)
{
    for(j=1;j<=10;j++)
    {
        printf("%d\t",i*j);
    }
    printf("%d\n");
}
}

4)
#include<stdio.h>
void main()
{
int i,j;
for(i=1;i<=20;i++)
{
for(j=1;j<=20;j++)
{
printf("%d\t",i*j);
}
printf("%d\n");
}
}

5)
//write a program to find absoolute value of any functions
//author:upendra
#include<stdio.h>
#include<math.h>
void main()
{
int a,Abs_val;
printf("Enter the number to find its absolute value:\n");
scanf("%d",&a);
Abs_val=fabs(a);
printf("Absolute value of number is %d",Abs_val);
}

6.)
// write a program to add character to get third character
//author: Upendra date:10/27/2020
#include <stdio.h>
void main()
{

    char ab;
    int z;
    printf("Enter the two characters:\n");
    scanf("%c%c", &a, &b);
    z = a + b;
    printf("Third character is %c"z);
}

7.)
/*write a program to take addmission in college
on following condition */
#include <stdio.h>
void main()
{
    int percage;
    char gendergame;
    printf("Press M for male \n Press F for female \n Press Y for played game \n Press N for not played game");
    scanf("%c%d%d", &gender, &perc, &age);
    printf("Did you played any game at national level \n");
    scanf("%c"game);
    if ((perc >= 80 && age >= 18 && gender == 'M') || (perc >= 70 && age >= 17 && gender == 'F'))
        ;
    printf("You can take addmission in college");
    {
        else
        {
            if (game == 'Y')
                printf("you can take addmission in sport kota");
            else
                printf("You can't take addmission in college");
        }
    }
}

8.)
#include<stdio.h>
void main()
{
int perc,age;
char gen,game;
printf("press M for male n F for female n Y for played game n N for not played game n");
scanf("%c%d%d",&gen,&perc,&age);
printf("did you played national game");
scanf("%c",&game);
if(perc>=80&&age>=18&&gen=='M'||perc>=70&&age>=17&&gen=='F')
    printf("You can take addmission in college");
}

9.)
#include<stdio.h>
void main()
{
int a=6;
do
{
printf("***********Welcome to air India***************\n");
printf("1.check your bags\n");
printf("2.check to switch off your device\n");
printf("3.check your ticket kept it safe\n");
printf("4.check your seat belt is tied properly\n");
printf("**********Have a Nice Happy journey************\n");
}
while(a<9);

}

10.)
/* write a program to check whether
 the alphabet is vowel or consonant */

#include<stdio.h>
void main()
{
    char ch;
    int n;
    printf("Enter any character:");
    scanf("%c%d",&ch,&n);
    if()


}


Digibytes - research

 

Diff b\w

Bitcoin and Digibyte

1. block---> 15s --Digi

2. block ---> 10m --Bit

3. transaction per second ---> 560 and BIT---->7 

4.Limited Supply But 21Billion only

last will be mined at 2035 year

5.Limited supply but 21million only lst mined 

at 2140


Crytocurrency - Digibytes

 

11.3667 - 10.112=1.254 -----> 1days p=-11.03%(Intraday Trading pata nhi abhi)

9-13 =  4 --->7days P=4  p=44.44%

6.51 - 12.69 = 6.18------> 30 days p=100%

2.29 - 12.21 = 9.92----> 3 months p=433.1877%

1.9191 - 10.07 = 8.1509 --------> YTD p=424.725%

1.6017 - 11.7284 = 10.1267 -----> 1 years p=632.2469%



speculation ----> jan -june (not always) ----> price Increases

            ----> after july decreases till end of december (Not always) 


Historical Price (Starts)=0.000656$ = rs 0.0443

Date 11th Feb 2014 trading Days first 

From the Day start profits is till now is after 8 years 27,642.611% Growths


That's means 100000 rs in digibytes return around 27426000 i.e approax 3 crores




Visibility and Z-Index

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Visibility and Z-Index</title>
</head>
<style>
.box{
    width150px;
    height150px;
    border2px solid black;
    border-radius10px;
}

#box1{
positionrelative;
top120px;
    background-colorred;
}
#box2{positionrelative;
z-index-150px;
}
#box3{
positionrelative;
z-index120px;
    background-color:green;
}
#box4{positionrelative;
z-index120px;

    background-color:blue;
}

</style>
<body>
    <div class="box" id="box1"></div>
    <div class="box" id="box2"></div>
    <div class="box" id="box3"></div>
    <div class="box" id="box4"></div>
</body>
</html>

CSS variable and custom

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS variable and custom </title>
</head>
<style>
    :root{
--primary-color:blue;
--secondary-color:green;
    }
.container{
border2px solid red;
displayflex;
height900px;
width700px;
background-colorvar(--secondary-color);
flex-directioncolumn;
align-itemscenter;
}
.box{
border2px solid blue;
height250p;
width200px;
margin5px 5px;
padding5px 2px;
/* align-self: center; */
align-selfflex-end;
align-contentcenter;
background-colorvar(--primary-color);
}


</style>
<body>
    <div class="container">
        <!-- <div class="box"></div> -->
        <div class="box"><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Laborum voluptatem iste rem quod, velit ab perspiciatis exercitationem soluta non sit debitis! In aliquam ea vel nostrum eveniet corporis incidunt quo et, iste animi necessitatibus.</p></div>
        <div class="box"><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Laborum voluptatem iste rem quod, velit ab perspiciatis exercitationem soluta non sit debitis! In aliquam ea vel nostrum eveniet corporis incidunt quo et, iste animi necessitatibus.</p></div>
        <div class="box"><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Laborum voluptatem iste rem quod, velit ab perspiciatis exercitationem soluta non sit debitis! In aliquam ea vel nostrum eveniet corporis incidunt quo et, iste animi necessitatibus.</p></div>
    </div>
</body>
</html>

Transition in css

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Transition in css </title>
</head>
<style>
    body{
background-colorblack;


    }
    
    
.box{colorwhite;
border2px solid white;
width250px;
height250px;
align-contentcenter;
background-colorred;
margin15px auto;

}
#box1{displayflex
text-aligncenter;
align-contentcenter;
justify-contentcenter;

align-itemscenter;
transition: background-color;
transition-propertyall;
transition-duration2s;
transition-delay2s;
transition-timing-functionease-in-out;
}

#box1:hover{
background-color:blue ;
border-radius15px;
height300px;
width300px;
font-size30px;

}



</style>
<body>

    <div class="container">

        <div class="box" id="box1">
            This is a Box1
        </div>
    </div>
    
</body>
</html>

Python if / else

 Python if / else a1 = int ( input (" Enter the number: \n ")) a2 = int ( input (" Enter the number: \n ")) a3 = int ( i...