Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lab 5 HW Spring 2017 v1.1
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//gcc 5.4.0 #include <stdio.h> #include <ctype.h> //Start Program //Char a; //Int x; //If a is letter //If a is a vowel //X=2 //If a is a consonet // X=1 //Else if a is a digit // X=3 // Else if a is a special character // X=4 // Else // X=5 //Switch (x) // Case 1: // Print character is a consonant // Break; // Case 2: // PRINT character is a vowel // Break; // Case 3: // Print Character is a digit // Break; // Case 4: // Print Character is a symbol // Break; // Default: // PRINT Character cannot be read //End Program int main(void){ char a; int x; scanf("%ch",&a); if(ispunct(a)){ x=4; } else{ x=5; } if(isalnum(a)){ if((a=='A')||(a=='a')||(a=='e')||(a=='E')||(a=='I')||(a=='i')||(a=='O')||(a=='o')||(a=='U')||(a=='u')||(a=='Y')||(a=='y')){ x=2; } else if(isdigit(a)){ x=3; } else{ x=1; } } //printf("%d\n",x); switch (x){ case 1: printf("Character is a consonant"); break; case 2: printf("character is a vowel"); break; case 3: printf("Character is a digit"); break; case 4: printf("Character is a symbol"); break; default: printf("Character cannot be read"); break; } }
gcc
!
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 0.12 sec, absolute running time: 0.14 sec, cpu time: 0 sec, memory peak: 3 Mb, absolute service time: 0,35 sec
edit mode
|
history
|
discussion
4 Character is a symbol