TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Simple C Program of While Loop and Switch Case
Krishna Rajput Singh
Jun 28
2015
Code
20.2
k
0
2
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
Simple C program usi
#include < stdio.h >
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int
main(
int
argc,
char
* argv[]) {
char
chc, ok;
ok =
'n'
;
while
(ok ==
'n'
) {
puts(
"Menu"
);
puts(
"1. Create a directory"
);
puts(
"2. Delete a Directory"
);
puts(
"3. Show a Directory"
);
puts(
"4. Exit"
);
puts(
""
);
switch
(chc) {
case
'1'
:
puts(
"Choice is 1"
);
break
;
case
'2'
:
puts(
"Choice is 2"
);
break
;
case
'3'
:
puts(
"Choice is 3"
);
break
;
case
'4'
:
puts(
"Choice is 4"
);
break
;
default
:
puts(
"Invalid Choice"
);
ok =
'n'
;
return
0;
getch();
}
}
}
C Language Program
Switch Case
while Loop