Top 5 basic knowledge of C programming

Top 10 basic knowledge of C programming. Today I discus about simple mathematics problems with solutions in C programming language. first c is a general-purpose programming language because it has been widely used for over 50 years. c programming language was created by Dennis Ritchie at the Bell Laboratories in 1972. C is mighty and popular, it has been used to develop operating systems, databases, applications, etc.

C is very popular and the main reason for its popularity is because it is a fundamental language in computer science. C is strongly associated with UNIX, as it was developed to write the UNIX operating system. I already described what is c programming and its advantages or disadvantages , so in this blog i only solve the some of c programming problem. so simple an easy Top 5 basic knowledge of C programming .

lets have see how to solve mathematics problem in C programming language:-

  1. Write a program to calculate sum of numbers given by user.

solution=>

#include<stdio.h>
#include<conio.h>
void main()

{

int a,b, sum;
printf(“enter the value of a & b”);
scanf(“%d %d”, &a, &b);

sum=a+b;
printf(“the sum of two numbers=%d”, sum);
getch();
}

and its result:

Top 5 basic knowledge of C programming
Top 5 basic knowledge of C programming
  1. write a program to calculate simple interest.

solution=>

#include<stdio.h>

#include<conio.h>

void main()
{

int si, p, t, r ;

printf("enter the principle");
scanf("%d", &p);
printf("enter the time");
scanf("%d", &t);
printf("enter the date");
scanf("%d", &r);

si= P*t*r/100;

 

printf(“the simple interest=%d”, si);
getct();
}

image

3. write a programme to calculate sum, product, difference and division of two numbers.

#include<stdio.h>

#include<conio.h>

void main()

{

int sum, p, a, b, sub, div;

printf(“enter the value of a:”);

scanf(“%d”, &a);

printf(“enter the value of b”);

scanf(“%d”, &b);

sum= a+b;

sub=a-b;

div=a/b;

p=a*b;

printf(“the sum of two numbers=%d”, sum);

printf(“the product of two numbers=%d”, p);

printf(“the difference of two numbers=%d”, sub);

printf(“the division of two numbers=%d”, div);

getch();

}

imAGE

4. write a programme to display square of numbers.

solution=>

#include<stdio.h>

#include<conio.h>

void main()

{

int s, a;

clrscr();

printf(“enter the value of a”);

scanf(“%d”, &a);

s= a*a;

printf(“the square of number=%d”, s);

getch();

}

image

5. write a C programme to dispaly your name and address.

solution=>

#include<stdio.h>

#include<conio.h>

void main()

{

char name[50]

char address[100]

printf(“enter the your name”);

scanf(“%d”, & name);

printf(“enter the your address”);

scanf(“%d”, & address);

printf(“name= %d”, name);

printf(“address=%d”, address);

getch();

}

 

6. write a programme to read four digit number & display it in reverse order.

solution=> 

                 # include<stdio.h>

                 #include<conio.h>

                     void main()

{

  int n;

printf(“enter the four digit number”);

scanf(“%d”, & n);

printf(“%d”, n%10);

n= n/10;

printf(“%d”, n%10);

n=n/10;

printf(“%d”, n%10);

n=n/10;

printf(“%d”, n%10);

n=n/10;

getch();

}

 

This is the Top 5 basic knowledge of C programming . I know this is not enough but i think this is the simple and basic important mathematics problem with solution in C programming language and i think it is help you must to know about simple mathematics problem and how to solve it in C programming. student who do not no how to do mathematics in C language they all are happy with this. and one more thing is if I doing mistake in some place please suggest me in comment through.

As we know C language is widely used and its important and it is very popular. It has been used to develop the system, database, and application etc. it has been the most famous programming language in the world since 1972. it has so many features included, which as fast speed compared to the other Programming languages, clean syntax, low-level memory Access to General purpose, etc. If you Learn C programming language you don’t need to learn any other language. C is very unique and popular so, it can be used in both applications and technologies.

I hope you all are understand all of this. if this blog help for your beginning of your C programming journey please comment below and any other thing if you want know for me please suggest me, thank you.

Leave a Comment

Your email address will not be published. Required fields are marked *