Giter Club home page Giter Club logo

c's Introduction

KenDzz 👋

🌐Socials

Facebook KenDzz LinkedIn

💻Tech Stack

CSS3 HTML5 JavaScript PHP Bootstrap Laravel CakePHP NodeJS React Jquery Web3 JS Python



c's People

Watchers

 avatar  avatar

c's Issues

test

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

void nhap(int a[]){

for(int i=0; i<10; i++){
	printf("Nhap gia tri mang a[%d]: ",i);
	scanf("%d",&a[i]);
}

}
void daonguocchieu(int a[]){

for(int i=9; i>=0; i--){
printf("a[%d]= %d\n",i,a[i]);
}
}

void xuat(int a[]){
for(int i=0; i<10; i++){
printf("a[%d]= %d\n",i,a[i]);
}
}
int ptnhonhat(int a[]){
int min = a[0];
for(int i=0; i<10; i++){
if(min > a[i])
min = a[i];
}
return min;
}

void tangdan(int a[]){
int tg;
for(int i=0; i< 9; i++){
for(int j=i+1; j<10; j++){
if(a[i] > a[j]){
tg = a[i];
a[i] = a[j];
a[j] = tg;
}
}
}
}

bool IsPrime(int n)
{
if (n < 2)
return false;
for (int i = 2; i <= sqrt(n); i++)
{
if (n % i == 0)
{
return false;
}
}
return true;
}

void PrintPrime(int a[], int n)
{
for (int i = 0; i < n; i++)
{
if (IsPrime(a[i]))
{
printf("%d\t", a[i]);
}
}
}

int main(){

int a[10];
int n=10;
nhap(a);
printf("--------------------------------\n");
printf("Gia tri nho nhat: %d\n",ptnhonhat(a));
printf("--------------------------------\n");
tangdan(a);
printf("Mang tang dan: \n");
xuat(a);
printf("--------------------------------\n");
printf("Dao nguoc mang: \n");
daonguocchieu(a);
printf("--------------------------------\n");
printf("Cac so nguyen to trong mang: \n");
PrintPrime(a,n);

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.