Home
About Us
Privacy Policy
Disclaimer
Contact Us
Breaking News
Home-icon
Web Development
_JavaScript
_php
Computer
_DLD
English
_Functional English
Programing
_JavaScript
_php
_Java
_C
Mega Menu
Home
programing
Even Odd using switch in C
Even Odd using switch in C
by -
Brain Light
on -
April 01, 2018
#include <stdio.h>
int main()
{
int i,n;
printf("enter anumber:\n");
scanf("%d",&n);
for(i=1;i<n;i=i+1)
{
switch(i%2)
{
case 0:
printf("The number %d is even:",i);
break;
case 1:
printf("The number %d is odd:",i);
break;
}
}
return 0;
}
Post a Comment
0 Comments
Social Plugin
Popular Posts
Facebook
Powered by Blogger
0 Comments
Your Comment is Submitted