Sunday, November 1, 2020

Pubg Mobile New Update Idea

Like there is 1 vs 4 we can play in the game, there should be an option where 2,3,4 can play against 1,2,3 as well.

C program of 1 to n sum, average, even sum & average, odd sum & average

 #include <stdio.h>

int main()

{

    int i,n,even=0,odd=0,sum=0,counteven=0,countodd=0,countsum=0;

    printf("Enter a number:");

    scanf("%d",&n);

    for(i=1;i<=n;i++)

    {

        printf("%d\n",i);

        sum+=i;

        countsum++;

        if(i%2==0)

        {

            even+=i;

            counteven++;

        }

        else

        {

            odd+=i;

            countodd++;

        }

    }

    printf("Sum=%d\n",sum);

    printf("Average=%d\n",sum/countsum);

    printf("Even Sum=%d\n",even);

    printf("Even Average=%d\n",even/counteven);

    printf("Odd Sum=%d\n",odd);

    printf("Odd Average=%d",odd/countodd);

    return 0;

}


C program to find even numbers, sum, average in between 1 to 10 using for loop and if....else statement

 #include <stdio.h>

int main()

{

    int i,sum,count=0;

    for(i=1;i<=10;i++)

    {

        if(i%2==0)

        {

        printf("%d\n",i);

        sum+=i;

        count++;

        }

    }

    printf("Sum=%d\n",sum);

    printf("Average=%d",sum/count);

    return 0;

}

C program to display even numbers, sum and their average in between 1 to 10

 #include <stdio.h>

int main()

{

    int i,sum;

    for(i=2;i<=10;i+=2)

    {

        printf("%d\n",i);

        sum+=i;

    }

    printf("Sum=%d\n",sum);

    printf("Average=%d",sum/5);

    return 0;

}


Displaying numbers 1 to 10 by running the loop for 5 times only in C

 #include <stdio.h>

int main()

{

    int i;

    for(i=1;i<=10;i+=2)

    {

        printf("%d%d",i,i+1);

    }

    return 0;

}

Running loop from 10 to 1 but displaying 1 to 10 in C

#include <stdio.h>

int main()

{

    int i;

    for(i=10;i>=1;i--)

    {

        printf("%d\t",11-i);

    }

    return 0;

C program for displaying the cube of 1 to 10 numbers

 #include <stdio.h>

int main()

{

    int i;

    for(i=1;i<=10;i++)

    {

        printf("%d\t",i*i*i);

    }

    return 0;

}

C program for developing the given number multiplication number

 #include <stdio.h>

int main()

{

    int i,n;

    printf("Enter a number:");

    scanf("%d",&n);

    for(i=1;i<=10;i++)

    {

        printf("%d x %d = %d\n",n,i,n*i);

    }

    return 0;

}


C program to display 1 to the given number in descending order

 #include <stdio.h>

int main()

{

    int i,n;

    printf("Enter a number:");

    scanf("%d",&n);

    for(i=n;i>=1;i--)

    {

        printf("%d",i);

    }

    return 0;

}

C program of even numbers in between 1-10

First Method:

#include <stdio.h>

int main()

{

    int i;

    for(i=2;i<=10;i+=2)

    {

        printf("%d",i);

    }

    return 0;

}


Second Method:
#include <stdio.h>
int main()
{
    int i,n;
    printf("Enter a number:");
    scanf("%d",&n);
    for(i=2;i<=n;i+=2)
    {
        printf("%d",i);
    }
    return 0;
}

C program to print 86 to 35 in descending order

 #include <stdio.h>

int main()

{

    int i;

    for(i=86;i>=35;i--)

    {

        printf("%d",i);

    }

    return 0;

}

Saturday, October 31, 2020

C program to find the smallest, middle and greatest number amongst the three given number

 #include <stdio.h>

int main()

{

    int a,b,c;

    printf("Enter a,b,c:");

    scanf("%d %d %d",&a,&b,&c);

    if(a>b)

    {

        if(a<c)

        {

            printf("%d is greatest\n",c);

            printf("%d is middle\n",a);

            printf("%d is smallest\n",b);

        }

        else if(b>c)

        {

            printf("%d is greatest\n",a);

            printf("%d is middle\n",b);

            printf("%d is smallest\n",c);

        }

        else

        {

            printf("%d is greatest\n",b);

            printf("%d is middle\n",c);

            printf("%d is smallest\n",a);

        }

    }

    else if(b<c)

    {

        printf("%d is greatest\n",c);

        printf("%d is middle\n",b);

        printf("%d is smallest\n",a);

    }

    else if(a>c)

    {

        printf("%d is greatest\n",b);

        printf("%d is middle\n",a);

        printf("%d is smallest\n",c);

    }

    else

    {

        printf("%d is greatest\n",c);

        printf("%d is middle\n",b);

        printf("%d is smallest\n",a);

    }

    return 0;

}


Shortcuts for Turbo C on keyboard

Activating menu bar: f10

Quitting a C program: Alt + X

Opening a new file: Alt + F - New

Closing a file: Alt + f3

Opening a file: f3

Saving a file: f2

Switching from one window to another: f6

Maximizing & restore: f5

Selecting text from the keyboard: Shift + arrow key

Deleting selected data: ctrl + delete

Undo: alt + backspace

Redo: Shift + alt + backspace

Copy: Ctrl + Insert

Paste: Shift + Insert

Cut (Move): shift + delete

Deleting a line: ctrl + Y

Compiling a program: alt + f9

Executing (Running) a program: ctrl + f9

Output window: alt + f5

Commenting a line (non-executable line): //


Syntax of a C program:

#include<stdio.h>                        (standard input output header file) 

#include<conio.h>                       (console input output header file)

void main()

{

    clrscr();

    getch();

}


C program to find the greatest number amongst the four given number

#include <stdio.h>

int main()

{

    int a,b,c,d;

    printf("Enter a,b,c,d:");

    scanf("%d %d %d %d",&a,&b,&c,&d);

    if(a>b)

    {

        if(a>c)

        {

            if(a>d)

            {

                printf("a");

            }

            else

            {

                printf("d");

            }

        }

        else if(c>d)

        {

            printf("c");

        }

        else

        {

            printf("d");

        }

    }

    else if(b>c)

    {

        if(b>d)

        {

            printf("b");

        }

        else

        {

            printf("d");

        }

    }

    else if(d>c)

    {

        printf("d");

    }

    else

    {

        printf("c");

    }

}

C program for the pyramid combination

    *
   * *
  * * *
 * * * *
* * * * *
 * * * *
  * * *
   * *
    *

#include <stdio.h>
int main()
{
    int i,j;
    for(i=1;i<=5;i++)
    {
        for(j=4;j>=i;j--)
        {
            printf(" ");
        }
        for(j=1;j<=i;j++)
        {
            printf("* ");
        }
        printf("\n");
    }
    for(i=1;i<=5;i++)
    {
        for(j=2;j<=i;j++)
        {
            printf(" ");
        }
        for(j=4;j>=i;j--)
        {
            printf(" *");
        }
        printf("\n");
    }
}

C program for the inverse pyramid

* * * * *

 * * * *

  * * *

   * *

    * 


#include <stdio.h>

int main()

{

    int i,j;

    for(i=1;i<=5;i++)

    {

        for(j=2;j<=i;j++)

        {

            printf(" ");

        }

        for(j=5;j>=i;j--)

        {

            printf("* ");

        }

        printf("\n");

    }

}

Friday, October 30, 2020

C program for the following pattern: 11111 2222 333 44 5

 11111

2222

333

44

5


#include <stdio.h>

int main() {

    int i,j;

    for(i=1;i<=5;i++)

    {

        for(j=5;j>=i;j--)

        {

            printf("%d",i);

        }

        printf("\n");

    }

}

C program for the following pattern: 5 44 333 2222 11111

5

44

333

2222

11111


#include <stdio.h>

int main() {

    int i,j;

    for(i=1;i<=5;i++)

    {

        for(j=1;j<=i;j++)

        {

            printf("%d",6-i);

        }

        printf("\n");

    }

}

C program of exam results

 #include <stdio.h>

int main() {

    float e,m,s,t,a;

    printf("Enter English,Maths,Science marks:");

    scanf("%f %f %f",&e,&m,&s);

    t=e+m+s;

    a=t/3;

    if(e>=35 && m>=35 && s>=35)

    {

        if(a>=70)

            printf("Distinction");

        else if(a>=60)

            printf("First Class");

        else if(a>=50)

            printf("Second Class");

        else

            printf("Pass Class");

    }

    else

        printf("Fail");

}

C program to calculate bonus

 #include <stdio.h>

int main() {

    float s,b;

    printf("Enter salary:");

    scanf("%f",&s);

    b=s*0.50;

    if(b<10000)

    {

        b=10000;

    }

    else if(b>25000)

    {

        b=25000;

    }

    printf("Bonus=%.2f",b);

}

C program for the following pattern: 1514131211 10987 654 32 1

 1514131211

10987

654

32

1


#include <stdio.h>

int main()

{

    int i,j,k=15;

    for(i=1;i<=5;i++)

    {

        for(j=5;j>=i;j--)

        {

            printf("%d",k);

            k--;

        }

        printf("\n");

    }

    return 0;

}

C program for the following pattern: 1 23 456 78910 1112131415

 1

23

456

78910

1112131415


#include <stdio.h>

int main()

{

    int i,j,k=1;

    for(i=1;i<=5;i++)

    {

        for(j=1;j<=i;j++)

        {

            printf("%d",k);

            k++;

        }

        printf("\n");

    }

    return 0;

}

C program for following pattern: 1 22 333 4444 55555

 1

22

333

4444

55555


#include <stdio.h>

int main()

{

    int i,j;

    for(i=1;i<=5;i++)

    {

        for(j=1;j<=i;j++)

        {

            printf("%d",i);    

        }

    printf("\n");

    }

    return 0;

}

C program for following pattern: 54321 4321 321 21 1

 54321

4321

321

21

1


#include <stdio.h>

int main()

{

    int i,j;

    for(i=5;i>=1;i--)

    {

        for(j=i;j>=1;j--)

        {

            printf("%d",j);    

        }

    printf("\n");

    }

    return 0;

}

C program for following pattern: 55555 44444 33333 22222 11111

55555

44444

33333

22222

11111


#include <stdio.h>

int main()

{

    int i,j;

    for(i=5;i>=1;i--)

    {

        for(j=1;j<=5;j++)

        {

            printf("%d",i);    

        }

    printf("\n");

    }

    return 0;

}

C program for following method: 54321 (5 times, 4 distinct methods)

54321

54321

54321

54321

54321


First Method:

#include <stdio.h>

int main()

{

    int i,j;

    for(i=1;i<=5;i++)

    {

        for(j=5;j>=1;j--)

        {

            printf("%d",j);    

        }

    printf("\n");

    }

    return 0;

}


Second Method:

#include <stdio.h>

int main() {

    int i,j;

    for(i=1;i<=5;i++)

    {

        for(j=1;j<=5;j++)

        {

            printf("%d",6-j);

        }

        printf("\n");

    }

}


Third Method:

#include <stdio.h>

int main() {

    int i,j;

    for(i=5;i>=1;i--)

    {

        for(j=1;j<=5;j++)

        {

            printf("%d",6-j);

        }

        printf("\n");

    }

}


Fourth Method:

#include <stdio.h>

int main() {

    int i,j;

    for(i=5;i>=1;i--)

    {

        for(j=5;j>=1;j--)

        {

            printf("%d",j);

        }

        printf("\n");

    }

}

Thursday, October 29, 2020

C program of salary system

First Method:

#include <stdio.h>

int main() {

    float s,e;

    char g;

    printf("Enter salary, work experience & grade:");

    scanf("%f %f %c",&s,&e,&g);

    if(e>=5)

    {

        if(g=='A'||g=='a')

        {

            s=s*2;

        }

        else if(g=='B'||g=='b')

        {

            s=s*1.75;

        }

        else if(g=='C'||g=='c')

        {

            s=s*1.60;

        }

        else if(g=='D'||g=='d')

        {

            s=s*1.50;

        }

        else

        {

            s=s*1.25;

        }

    }

    else

    {

        s=s*1.15;

    }

    printf("Net Salary=%.2f",s);

}


Second Method:

#include <stdio.h>

int main() {

    float e,s;

    char g;

    printf("Enter experience,salary and grade:");

    scanf("%f %f %c",&e,&s,&g);

    if(e>=15)

    {

        if(g=='A'||g=='a')

        {

            s=s*2;

        }

        else if(g=='B'||g=='b')

        {

            s=s*1.75;

        }

        else if(g=='C'||g=='c')

        {

            s=s*1.60;

        }

    }

    else if(e>=10)

    {

        s=s*1.5;

    }

    else if(e>=5)

    {

        s=s*1.4;

    }

    else

    {

        s=s*1.25;

    }

    printf("Net Salary=%.2f",s);

}


C program of electricity bill

 #include <stdio.h>

int main() {

    int u;

    printf("Enter units consumed:");

    scanf("%d",&u);

    if(u<=100)

        printf("Net Bill=%d",u);

    else if(u<=200)

        printf("Net Bill=%d",100+(u-100)*1);

    else if(u<=300)

        printf("Net Bill=%d",250+(u-200)*2);

    else if(u<=400)

        printf("Net Bill=%d",500+(u-300)*3);

    else

        printf("Net Bill=%d",750+(u-400)*5);

}

C program of grading system

First Method:

#include <stdio.h>

int main() {

    float e,m,s,t,a;

    printf("Enter English,Maths,Science marks:");

    scanf("%f %f %f",&e,&m,&s);

    t=e+m+s;

    a=t/3;

    printf("Total=%.2f,Average=%.2f\n",t,a);

    if(a>=70)

        printf("Distinction");

    else if(a>=60)

        printf("First Class");

    else if(a>=50)

        printf("Second Class");

    else if(a>=35)

        printf("Pass Class");

    else

        printf("Fail");

}


Second Method:

#include <stdio.h>

int main() {

    float e,m,s,t,a;

    printf("Enter English,Maths,Science marks:");

    scanf("%f %f %f",&e,&m,&s);

    t=e+m+s;

    a=t/3;

    printf("Total=%.2f,Average=%.2f\n",t,a);

    if(a<35)

        printf("Fail");

    else if(a<50)

        printf("Pass Class");

    else if(a<60)

        printf("Second Class");

    else if(a<70)

        printf("First Class");

    else

        printf("Distinction");

}

C program of admission

 #include <stdio.h>

int main() {

    float m,s,e;

    printf("Enter Maths, Science & English:");

    scanf("%f %f %f",&m,&s,&e);

    printf("Total = %.2f, Average = %.2f\n", m+s+e, (m+s+e)/3);

    if(m+s+e>=200)

    {

        printf("Admission Confirmed");

    }

    else if(m+s>=150)

    {

        printf("Admission Confirmed");

    }

    else

    {

        printf("Admission unconfirmed");

    }

}

C program to find profit or loss or nothing

#include <stdio.h>

int main() {

    float p,s;

    printf("Enter purchase & selling amount:");

    scanf("%f %f",&p,&s);

    if(p<s)

    {

        printf("Profit=%.2f",s-p);

    }

    else if(p>s)

    {

        printf("Loss=%.2f",p-s);

    }

    else

    {

        printf("No profit or loss");

    }

}

C program of the greatest or the equal number amongst two given numbers

#include <stdio.h>

int main() {

    int x,y;

    printf("Enter x & y:");

    scanf("%d %d",&x,&y);

    if(x>y)

    {

        printf("x=%d is greatest",x);

    }

    else if(y>x)

    {

        printf("y=%d is greatest",y);

    }

    else

    {

        printf("x=y=%d",x);

    }

}

Purchasing & Selling Amount (C Program)

 #include <stdio.h>

int main() {

    float p,s;

    printf("Enter purchase & selling amount:");

    scanf("%f %f",&p,&s);

    if(p<s)

    {

        printf("Profit of %.2f Rs",s-p);

    }

    else

    {

        printf("Loss of %.2f Rs",p-s);

    }

}

Wednesday, October 28, 2020

C program to find the greatest of two numbers

#include <stdio.h>

int main() 

{

    int a,b;

    printf("Enter a & b:");

    scanf("%d%d",&a,&b);

    if(a>b)

    {

        printf("a=%d is greatest",a);

    }

    else

    {

        printf("b=%d is greatest",b);

    }

    return 0;

}

Tuesday, October 27, 2020

The bar graphs and line graphs depicts about the water taken from the water resources and making use of it for different purposes in different continents. (Ielts Writing Task)

 It can be seen from the graphs that Asia has been the most withdrawing as well as most consuming water continent. In it only it is seen that the gap between withdrawal and consumption is around 1000 km cube per year which is a huge amount of water wasted.

Australia and Oceania are the least in both withdrawal and consumption. North America, South America, Europe, and Africa amount is in between Asia, Australia and Oceania.

From line graphs, it can be said that the withdrawal of water has been increasing throughout the years which will be increasing only in the near future. The consumption of water is slightly slowly increasing throughout the years which also be increasing in near future.

It can be said that the wastage has remained in huge amount throughout which also be the same in near future.

Do you feel it is better for young people learning school to study further at university or go straight into the workplace? Give reasons for your answer and include any relevant examples from your knowledge or experience (Ielts Writing Task)

Nowadays the main concern or tension for the parents regarding their child is what choice should be apt for them toward the better future amongst further studies or joining the job at the company.

Both choices have their own pros and cons which will be discussed in this essay. It is also a tough decision for the child whether to study more or join the company.

Talking about further studies can help the child acquiring more knowledge related to the specific field. It can grow the theoretical as well as practical knowledge. Also after acquiring a specific degree in the field, a special brand is been created. The person is treated in different ways as compared to the lower degree achiever, whereas some company requires work experience which will not be present in the resume of the student.

Joining at the workplace directly after studies are both good as well as bad. Because till now only the student had studied the concept or maybe has performed some practicals. So it must be a difficult situation for him/her to get settled in the working environment. But nowadays the companies are offering an internship where the student is given a hands-on experience which can help them in working easily there. Most companies provide the training related to their work whereas some assign tasks to the freshers through which the child has to go through.

Once the student goes for the job in future it will be very difficult to get back to studies if thinking of. Thus as described above both choices have their own advantages as well as disadvantages according to me.


Monday, October 26, 2020

if grade is A then salary is double otherwise 50% bonus

 #include <stdio.h>

int main() 

{

    float s;

    char g;

    printf("Enter salary & grade:");

    scanf("%f %c",&s,&g);

    if(g=='A')

    {

        s=s*2;

    }

    else

    {

        s=s*1.5;

    }

    printf("Net Salary=%.2f",s);

}

If work experience is greater than 5 then bonus 50% otherwise 25%

 #include <stdio.h>

int main() 

{

    float s,e;

    printf("Enter salary & work experience:");

    scanf("%f %f",&s,&e);

    if(e>=5)

    {

        printf("Net Salary=%.2f",s*1.5);

    }

    else

    {

        printf("Net Salary=%.2f",s*1.25);

    }

}

Sunday, October 25, 2020

C program: If the purchase amount is greater than 2000 20% discount otherwise 5% discount

First Method:

#include <stdio.h>

int main() {

    float n;

    printf("Enter the purchase amount:");

    scanf("%f",&n);

    if(n>=2000)

    {

        printf("Net Pay=%.2f",n-(n*0.20));

    }

    else

    {

        printf("Net Pay=%.2f",n-(n*0.05));

    }

}

Second Method:

#include <stdio.h>

int main() {

    float n;

    printf("Enter the purchase amount:");

    scanf("%f",&n);

    if(n>=2000)

    {

        printf("Net Pay=%.2f",n*0.80);

    }

    else

    {

        printf("Net Pay=%.2f",n*0.95);

    }

}

C program to check whether the given year is a leap year or not

#include <stdio.h>

int main() {

    int y;

    printf("Enter a year:");

    scanf("%d",&y);

    if(y%4==0)

    {

        printf("%d is a leap year",y);

    }

    else

    {

        printf("%d is not a leap year",y);

    }

}

C program to display the negative of the given positive number and vice-versa

 #include <stdio.h>

int main() {

    int n;

    printf("Enter a number:");

    scanf("%d",&n);

    n=-n;

    printf("Number=%d",n);

}

Saturday, October 24, 2020

c program to display whether the given number is even or odd

 #include <stdio.h>

int main() {

    int n;

    printf("Enter a number:");

    scanf("%d",&n);

    if(n%2==0)

    {

        printf("N is even", n);

    }

    else

    {

        printf("N is odd",n);

    }

}

If the given number is positive, display the square and the cube otherwise display an error (C program)

#include <stdio.h>

int main() {

    int n;

    printf("Enter a number:");

    scanf("%d",&n);

    if(n>0)

    {

        printf("Square=%d, Cube=%d",n*n,n*n*n);

    }

    else

    {

        printf("Enter a positive number");

    }

}

If the grade is A then double the salary (c program)

 #include <stdio.h>

int main() {

    float s;

    char g;

    printf("Enter salary and grade:");

    scanf("%f %c", &s, &g);

    if(g=='A')

    {

        s=s*2;

    }

    printf("Net Salary=%.2f",s);

}

If the work experience is more than 5 years then the bonus is 50%

 #include <stdio.h>

int main() {

    float we,s;

    printf("Enter Work Experience & Salary:");

    scanf("%f%f",&we,&s);

    if(we>=5)

    {

        s=s*1.5;

    }

    printf("Salary=%.2f",s);

}

If the purchase amount is more than 2000 Rs, the discount is of 20%

#include <stdio.h>

int main() {

    float pa;

    printf("Enter Purchase Amount:");

    scanf("%f",&pa);

    if(pa>=2000)

    {

        pa = pa - (pa*0.2);

    }

    printf("Net Payable=%.2f",pa);

}

c program to check whether the given year is not a leap year

 #include <stdio.h>

int main() {

    int y;

    printf("Enter year:");

    scanf("%d",&y);

    if(y%4!=0)

    {

        printf("%d is not a leap year",y);

    }

}

c program to check whether the given year is a leap year

#include <stdio.h>

int main() {

    int y;

    printf("Enter year:");

    scanf("%d",&y);

    if(y%4==0)

    {

        printf("%d is a leap year",y);

    }

}

Friday, October 23, 2020

Based on the work experience and grade, calculate the net salary in C.

#include <stdio.h>

int main() 

{

    float s,e;

    char g;

    printf("Enter s,e,g");

    scanf("%f %f %c",&s,&e,&g);

    if(e>=5)

    {

        if(g=='a'||g=='A')

        {

            s=s*2;

        }

        else if(g=='B'||g=='b')

        {

            s=s*1.75;

        }

        else if(g=='c'||g=='C')

        {

            s=s*1.60;

        }

        

        else if(g=='D'||g=='d')

        {

            s=s*1.50;

        }

        else

        {

            s=s*1.25;

        }

    }

printf("Net Salary:%.2f",s);

}

Calculate the net salary based on work experience and grade in C

 #include <stdio.h>

int main() 

{

    float e, s;

    char g;

    printf("Enter e,s,g");

    scanf("%f %f %c",&e,&s,&g);

    if(e>=15)

    {

        if(g=='A'||g=='a')

        {

            s=s*2;

        }

        else if(g=='B'||g=='b')

        {

            s=s*1.75;

        }

        else if(g=='C'||g=='c')

        {

            s=s*1.60;

        }

    }

    else if(e>=10)

    {

        s=s*1.5;

    }

    else if(e>=5)

    {

        s=s*1.4;

    }

    else

    {

        s=s*1.25;

    }

    printf("Net Salary=%.2f",s);

}

Wednesday, October 21, 2020

c program to display if the given number is odd (2 different methods)

First Method:

#include <stdio.h>

int main()

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    if(n%2!=0)

    {

        printf("Number=%d is odd",n);

    }

}


Second Method:

#include <stdio.h>

int main()

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    if(n%2==1)

    {

        printf("Number=%d is odd",n);

    }

}

if the given number is greater than 0 calculate its square and cube - c program

#include <stdio.h>

int main() 

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    if(n>0)

    {

        printf("Number = %d, Square = %d, Cube = %d", n, n*n, n*n*n);

    }

}

Display the given number if it is equal to zero in c

 #include <stdio.h>

int main() 

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    if(n==0)

    {

        printf("Number is zero");

    }

}

Monday, October 19, 2020

Display the given number if it is negative using if statement in c

 #include <stdio.h>

int main()

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    if(n<0)

    {

        printf("%d is negative", n);

    }

    return 0;

}

display the double of the given number if it is less than 50 in c

 #include <stdio.h>

int main()

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    if(n<50)

    {

        printf("Number = %d", n*2);

    }

    return 0;

}

c program to display the given number if it is less than 25

 #include <stdio.h>

int main()

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    if(n<25)

    {

        printf("Number = %d", n);

    }

    return 0;

}

display the given number if it is greater than 100

 #include <stdio.h>

int main()

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    if(n>=100)

    {

        printf("Number = %d", n);

    }

    return 0;

}

swapping numbers in c (2 unique different methods)

First Method:

#include <stdio.h>

int main()

{

    int a, b, c;

    printf("Enter A & B:");

    scanf("%d%d", &a, &b);

    printf("Before swapping: a = %d, b = %d", a, b);

    c=a;

    a=b;

    b=c;

    printf("\nAfter swapping: a = %d, b = %d", a, b);

    return 0;

}


Second Method:

#include <stdio.h>

int main()

{

    int a, b, c;

    printf("Enter A & B:");

    scanf("%d%d", &a, &b);

    printf("Before swapping: a = %d, b = %d", a, b);

    a=a+b;

    b=a-b;

    a=a-b;

    printf("\nAfter swapping: a = %d, b = %d", a, b);

}

c program of bonus in net salary

First Method:
#include <stdio.h>
int main() {
    float s, b, ns;
    printf("Enter salary:");
    scanf("%f", &s);
    b = s * 0.50;
    ns = s + b;
    printf("Net Salary = %.2f", ns);
    return 0;
}

Second Method:
#include <stdio.h>
int main() {
    float ns;
    printf("Enter salary:");
    scanf("%f", &s);
    ns = ns + (ns * 0.50);
    printf("Net Salary = %.2f", ns);
    return 0;
}

Third Method:
#include <stdio.h>
int main() {
    float ns;
    printf("Enter salary:");
    scanf("%f", &s);
    printf("Net Salary = %.2f", ns * 0.5);
    return 0;
}

c program of salary net pay with discount

First Method:

#include <stdio.h>

int main() {

    float n, d, np;

    printf("Enter a number:");

    scanf("%f", &n);

    d = n * 0.10;

    np = n - d;

    printf("Pay Rs = %.2f", np);

    return 0;

}


Second Method:

#include <stdio.h>

int main() {

    float np;

    printf("Enter a number:");

    scanf("%f", &np);

    np = np - (np * 0.10);

    printf("Pay Rs = %.2f", np);

    return 0;

}


Third Method:

#include <stdio.h>

int main() {

    float np;

    printf("Enter a number:");

    scanf("%f", &np);

    printf("Pay Rs = %.2f, np * 0.9);

    return 0;

}

How to find given percent of the given number in c

#include <stdio.h>

int main() {

    float n, p;

    printf("Enter a number and percentage:");

    scanf("%f%f", &n, &p);

    printf("Number and percent of the number is %.2f and %.2f", n, n*(p/100));

    return 0;

}

c program to find 20% of a number

#include <stdio.h>

int main() {

    float n;

    printf("Enter a number:");

    scanf("%f", &n);

    printf("Answer is %.2f", n*0.20);

    return 0;

}

Sunday, October 18, 2020

c program to find cube and square of a number (3 distinct methods)

First Method:

#include <stdio.h>

int main() {

    int n, s, c;

    printf("Enter Number:");

    scanf("%d", &n);

    s = n * n;

    c = n * n * n;

    printf("Number = %d", n);

    printf("\nSquare = %d, Cube = %d", s, c);

    return 0;

}


Second Method:

#include <stdio.h>

int main() {

    int n;

    printf("Enter Number:");

    scanf("%d", &n);

    printf("Number = %d", n);

    printf("\nSquare = %d, Cube = %d", n*n, n*n*n);

    return 0;

}


Third Method:

#include <stdio.h>

int main() {

    int n;

    printf("Enter Number:");

    scanf("%d", &n);

    printf("Number = %d, Square = %d, Cube = %d", n, n*n, n*n*n);

    return 0;

}

Saturday, October 17, 2020

c program to find the cube of a number (3 different methods)

First Method:

#include <stdio.h>

int main()

{

    int n, c;

    printf("Enter a number:");

    scanf("%d", &n);

    c = n * n * n;

    printf("Number = %d", n);

    printf("\nCube = %d", c);

    return 0;

}


Second Method:

#include <stdio.h>

int main()

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    printf("Number = %d", n);

    printf("\nCube = %d", n * n * n);

    return 0;

}


Third Method:

#include <stdio.h>

int main()

{

    int n;

    printf("Enter a number:");

    scanf("%d", &n);

    printf("Number = %d \n Cube = %d", n, n * n * n);

    return 0;

}

simple c program to half the number

 #include <stdio.h>

int main()

{

    int n;

    printf("Enter n:");

    scanf("%d", &n);

    n = n / 2;

    printf("Answer = %d", n);

    return 0;

}

c program to double the number

#include <stdio.h>


int main()

{

    int n;

    printf("Enter n:");

    scanf("%d",&n);

    n = n * 2;

    printf("Answer = %d", n);


    return 0;

}

Monday, September 28, 2020

Every year several languages die out. Some people think that this is not important because life will be easier if there are fewer languages in the world? (IELTS Writing Task)

 Languages represent the people belonging to the specific region. Today in the whole world there are many languages. According to the national language, it is easy for people to recognise the belonging to the country.

German in Germany, French in France, Italian in Italy like are the national languages of their respective countries. English has remained a standard language over time for most of the country or continent to communicate with each other.

Sometimes the people faces problems while travelling other countries in communication. Due to the language difference, it becomes quite difficult for any conversation. Thus then a standard language can provide a relief to both the parties.

Nowadays due to the depletion of the people of a few specific communities, the languages get less spoken and eventually dies every year. Thus the new generation adapts the standard language or other language. As a result, the whole community may vanished.

According to some people vanishing of languages, every year is not important. It will be easier to deal with fewer languages. After which language barrier will not be a hindrance in exchanging information or travelling. It will be easy for any people to have conversation with other people.

People faces many difficulties while travelling, or chatting/talking with other people. Thus the lesser languages will remove that barrier. Nowadays there are few apps developed which helps you in translating text or voice from one language to another but it takes time or sometimes it may not work correctly or also may translate wrong which can affect the situation.

Learning second language has remain a difficult task for anyone. Thus lesser the languages, easier will be the communication. Also the person will not have to learn other languages.

IELTS Writing Task

The given diagram depicts the energy consumed from the different sources in quadrillion units during the time period of 1980 till 2030.

As can be seen from the diagram that since the 1980s, petrol and oil have been used much more as compared to the other sources of energy. In future also the consumption of energy from petrol and oil will be increasing only. The usage remaining around 40 quadrillion units.

Talking about coal and natural gas, the usage has remained around 20 quadrillion units. The natural gas usage will remain constant in near future, whereas the coal consumption will increase. Nuclear, solar/wind, hydropower source of energy has been remained low as compared to other sources. In near future amongst three sources of energy, the usage of nuclear energy will increase, whereas solar/wind will remain in between and hydropower will remain the least used.

From the figure, the usage of non-renewable energy sources had remained more since early time till the near future whereas the usage of renewable energy sources had remain less and will also remain less in coming time.

Sunday, September 27, 2020

how to add negative numbers in list in python

 given_list = [5, 4, 4, 3, 1, -2, -3, -5, -7]

total = 0

i = 0

while(i < len(given_list)):

    if given_list[i] < 0:

        total += given_list[i]

        i += 1

print(total)

Friday, September 25, 2020

IELTS Writing Task: Cigarette Diagram

It can be said from the figure that the whole structure within the cigarette is shown. The cigarette can be divided into two parts: the part which is burnt and the part from where it is inhaled.

Firstly talking about the small part from where the cigarette is inhaled, there is only paint done on the part so that it looks attractive. The other part contains many of the things which combined constitutes it. It is a mixture of every element used which can be described as Butane lighter fluid which helps cigarette to be burnt, Acetic acid vinegar which is used for some change in taste and smell, Methane sewer gas which acts as a catalyst in burning, Arsenic poison whose name only contains poison in it thus can be considered as dangerous to health, and Methanol rocket fuel also is helpful in burning.

Cadmium Batteries are also installed, Stearic acid candle wax helps in burning; Hexamic barbecue lighter,  Toulene industrial solvent, nicotine insecticide, ammonia toilet cleaner liquids introduced in the form of solid and kept in cigarette which also helps in burning.

It can only be seen from the dangerous elements like poison, gases, liquid, etc. involved which are harmful, thus it can be said that the cigarette as a whole definitely would be dangerous to the health. 

Tuesday, September 22, 2020

IELTS Writing Task

In the given figure, two different blueprints are drawn. Amongst which, one is of the present time and another one is of the plan of future in 2020.

It can be seen from the figure that in the present time the entrance is given from the garden's footpath whereas in future the entrance will be from the road that is next to the bus stop.

The reception is located at the sideways in the current time whereas in future the reception will be located as we enter the college.

The plan will be extended in future by covering up the garden thus making more space for other departments. The footpath beside the car park will also be removed, thus increasing the capacity of the car park in 2020. Also, the numbers of classrooms will also get increased. The shops will be newly introduced in the future.

There will be an expansion of the plan in the future but there will be a decrease in the natural beauty by removing the garden and also by changing the entrance from the garden into the road. 

Sunday, September 20, 2020

IELTS Writing Task

 In the given pie-charts, the comparisons are made between the different age groups watching different TV genres. From the pie-chart, we can say that the 10-15 years old belongs to children category, whereas 16-20 and 21-25 years old belongs to teenagers and adults respectively.

It can be seen that sport and cartoon are equally popular among children's. The film and the drama are little less enjoyed by the children comprising of 23% and 19% respectively, whereas the news is the least comprising in the category only 6% of the whole chart.

In teenagers, the drama is the most popular watched category, whereas other genres are less seen as compared to the drama which can be written in decreasing order: Film comprising of 23%, news comprising of 18%, cartoon comprising of 15%, and sport is the least seen 14% among the other TV genres watched.

In adults, sport is the least-watched on TV comprising only 4% of the chart, whereas the highest watched on TV is news comprising of 33%. The drama, cartoon and film are evenly approximately divided comprising of 22, 20, and 21 % respectively.

Thus it can be concluded that sport and cartoon are popular among the children whereas it decreases by growing age, and the news gets increased as per the growing age.

Amazon Web Services for National Health Service

 AMAZON WEB SERVICES (AWS) 

 Amazon Web Services are well known for providing cloud computing platforms and APIs on-demand to governments, companies, and individuals based on the scaled pay-as-you-go service. Amazon Web Services is a subdivision of Amazon (Muni and Hansen, 2005). Amazon Web Services (AWS) is a widely endorsed cloud platform which offers more than 175 services that are featured fully from data centres worldwide. Many customers including important government firms, rapidly evolving start-ups, and huge businesses use AWS for efficient innovation, lowering prices, and becoming agile (AWS, 2019). It is important to fully understand AWS as a service before making any security queries. 


  1. Functionality 

AWS has a noteworthy range of extra services that makes it stand out from other cloud providers. Their services include fundamental technologies like storage, databases and computing, artificial intelligence, machine learning, data analytics, lakes and the internet of things. These can result in constructing anything which can be imagined along with making it more cost-effective, simple, and rapid; leading to move the prevailing applications to the cloud. Within those services, AWS has the most extensive functionality. For selecting the correct tool in terms of performing a task with optimal performance, AWS provides the extensive range of databases which are built on purpose for the varied kind of applications for instance (AWS, 2019). 


  1. Community 

With millions of operative customers and tens of thousands of collaborators worldwide, AWS has an active community. Users including public sector organisations, start-ups, and enterprises are operating every conceivable use-case on AWS, virtually covering almost every company of varying sizes. Tens of thousands of independent software vendors (ISVs) who adapted their technology to operate on AWS, along with thousands of AWS services specialised in system integration, are included in the AWS Partner Network (APN) (AWS, 2019). 


  1. Security 

AWS is supposedly developed to be the most reliable and accessible cloud computing environment in recent times. For satisfying the worldwide banks, armed forces, and other important organizations security requisite, the basic infrastructure is manufactured. This is supported by an extensive number of cloud security tools including 230 administration, compliance and security features and services. AWS also supports compliance certifications, 90 security standards and all 117 AWS services which store customer data, allowing the potential of encrypting the data (AWS, 2019). 


  1. Rapid Innovation 

The most recent technologies can be leveraged for experimenting and innovating rapidly with AWS. AWS are continuously pacing their speed of innovation for inventing completely new technologies which can be used for transforming businesses. For instance, AWS has introduced the launch of “AWS lambda” – the serverless computing space that allows developers to run their code without managing or provisioning servers in 2014. In addition, AWS built Amazon SageMaker, a fully managed machine learning service that empowers everyday developers and scientists to use machine learning without any previous experience. (AWS, 2019). 


  1. Functional Expertise 

AWS has incomparable performance, security, reliability, and experience on which the most vital applications can rely. AWS is distributing cloud services to many customers worldwide managing a broad diversity of use cases for more than 13 years. To a large extent, AWS has the greatest functional experience when compared to any other cloud provider (AWS, 2019). 


  1. NATIONAL HEALTH SERVICE (NHS) 

Within the United Kingdom, there is a publicly funded healthcare system known as the National Health Service (NHS) which has been funded through universal taxation from 1948. Within the NHS, there are four organisations which serve each respective area of the UK: Health and Social care in Northern Ireland, NHS Scotland, NHS in England, and NHS Wales. The main aim is to deliver a very effective and omnipresent service, which should be free of cost at the time of shipment. These services contain an inclusive range of health services and there is no cost for those people who are United Kingdom residents, excluding optical care and dental treatment (National Health Service, 2020). 


  1. NHS Digital 

In England, NHS Digital supplies technology and information for the healthcare system. The company has a group of information investigation, technology, and project management specialists who produce, grasp, and control the critical digital system, services, products and standards-based on healthcare professionals, and citizens. The main vision of NHS Digital is to tackle the strength of information and technology in advancing health as well as the healthcare of British citizens (NHS Digital & Privitar – Amazon Web Services (AWS), 2020). 


  1. Benefits

  • Preserving patient privacy of millions of patients 

  • Enlarging worldwide territory by AWS collaboration 

  • Enhancing healthcare by providing accurate data of the patients 

  • Properly maintaining tenfold data increase 


  1. PRIVITAR 

Privitar, located in London, England, produces software made for enterprise-wide privacy security, which allows the power of controlling, using, and sharing the data safely to global organizations. Privitar is a member of the AWS Public Sector Partner Program and an AWS Advanced Technology Partner. 


  1. AWS AND NHS DIGITAL – PRIVITAR 

Privitar assists NHS Digital with improving the usage of health data and protecting the privacy of patient with AWS through the following means: 

  • Helping healthcare organizations dealing supplementary with patient data 

  • Executing patient de-identification and data-linking solutions on AWS 

  • Enhancing healthcare, securing patient privacy 

  • Tenfold data increase supported scaling 

  • Expanding worldwide reach by collaborating with AWS (NHS Digital & Privitar – Amazon Web Services (AWS), 2020) 

It is understood that the NHS processes a large amount of personal data from the public and therefore a centralised computing body would be beneficial for efficiency and ease of comprehensive data processing and use.


References 

Muni, A. and Hansen, J. (2005) ‘Amazon web services’, Dr. Dobb’s Journal, 30(12), pp. 66–67. 

AWS (2019) ‘Cloud computing with AWS’, p. 3. Available at: https://aws.amazon.com/what-is-aws/. 

Jackson, L. N. (1948) ‘National Health Service’, The Lancet, 251(6495), p. 307. doi: 10.1016/S0140-6736(48)91719-X. 

Stories, P. S. (2020) ‘Privitar Helps NHS Digital Improve Health Data Use and Protect Patient Privacy with AWS Helping Healthcare Organizations Do More with Patient Data’, pp. 1–6. 

How to Fight Overthinking or Negative Thoughts?

How to Combat Overthinking or Negative Thoughts? 1. Don’t Fight Your Thoughts Trying to suppress or control negative thoughts often backfire...