The output of the program is:
The source code for the above program is"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
int main() | |
{ | |
int n=100,evencount=0,oddcount=0; | |
while(n!=1) | |
{ | |
printf("enter any number"); | |
scanf("%d",&n); | |
if(n%2==0){ | |
evencount++; | |
} | |
else | |
oddcount++; | |
} | |
printf("the total no the even number until user entered 1 is %d\n",evencount); | |
printf("the total of the odd number enterd until user enters 1 is %d\n",oddcount); | |
} |
0 comments :
Post a Comment