Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions 001.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdio.h>

/*A program that prints the alphabet in lowercase, followed by a new line.
* Print all the letters except q and e
* use printf
*/

int main ()
{
char apl;


for (apl = 'a'; apl <= 'z'; apl != 'e'; apl != 'q'; apl++)
{
printf ("%c", apl);
}


return (0);
}
35 changes: 35 additions & 0 deletions 002.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <stdio.h>

/*A program that asks and reads the score of a user
* If the score is less than 80, display to the user that they are not elgible to be enrolled.
* If the score is greater than or equal 80, they can be enrolled.
*/

#include <stdio.h>


int main()
{
int user;
int score = 80;

printf("Enter your score: ");
scanf("%c", &score);

if(user < 80)
{

printf("Sorry, you are not eligible to be enrolled\n", score);
scanf("%c", &score);

}

if(user => 80)
{
printf("Congratulations! You are eligible to be enrolled");
scanf("%c", &score);
}

return (0);
}

32 changes: 32 additions & 0 deletions 003.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <stdio.h>

/*
* A task that displays Odd number,even number and zero
* If the number is even,it displays 'userInput is even'
* If the number is zero,it displays 'This is zero'
* If the number is odd, it displays 'UserInput is odd'
*/

int main()
{
int num;
int num1;

printf ("Enter your number: ");
scanf("%c", &num);

if (num == num1 == 0)
{
printf ("UserInput is even\n");
}

if (num / num1 == 1 )
{
printf ("UserInput is odd");
}

if (num == 0)
{
printf ( "This is Zero");
}
return (0);
26 changes: 26 additions & 0 deletions 004.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <stdio.h>



/* A program that asks, reads and displays the name, age of a user.
* Name is David
* Age is 65
*/

int main()
{
int name = David;
int age = 65;

printf("What is your name: \n");
scanf("%d", name);

printf("What is your age: \n");
scanf("%d", age);

printf("Your name is %d and you are %d years old");

return 0;

}