Commit 7a8c8958 by ILaha AHmadzada

Merge branch 'master' of https://gitlab.pld.ttu.ee/ilahma/iax0583

parents 0a4c902c fcb85b63
#include<stdio.h>
int main() {
int i=0, number[10];
for(i=0; i<10; i++){
number[i]=i+1;
printf("%d\n", number[i]);
}
for(i=0; i<10; i++)
{
if(number[i]%2==1)
{
printf("%d\n",number[i]);
}
}
printf("\n");
for(i=0; i<10; i++)
{
if(number[i]%2==0)
{
printf("%d\n",number[i]);
}}
printf("\n");
for(i=9; i>=0; i--)
{
printf("%d\n",number[i]);
}
printf("\n");
return 0;
}
#include <stdio.h>
int main() {
int i;
int j;
int swap=0;
int N;
printf("PLease, enter array size: ");
scanf("%d", &N);
int array[N];
for(i=0;i<N;i++) {
printf("Please, enter element of the array :\n\n");
scanf("%d",&array[i]); }
for(i=0;i<N;i++) {
for(j=0;j<N-1;j++){
if(array[j]<array[j+1]){
swap=array[j];
array[j]=array[j+1];
array[j+1]=swap;
}
}
}
for(i=0; i<N; i++){
printf("%d\n",array[i]);
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment