Q#1_LAB_7

2 views
Skip to first unread message

MUNAM NAUMAN

unread,
Dec 26, 2011, 12:33:29 AM12/26/11
to Learn C Language
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main (void)
{
int a,s,even=0,odd=0,zeros=0;
clrscr();
printf("Enter 30 Integers\n");

s=1;
while(s<=30){
scanf("%d",&a);
s++;
if(a!=0&&a%2==0){
++even;
}
else if(a%2!=0){
++odd;
}
else{
++zeros;
}
}
printf("\nEVEN = %d",even);
printf("\nODD = %d",odd);
printf("\nZEROS = %d",zeros);
getch();
return 0;

}

MUNIB UL HASSAN

unread,
Dec 27, 2011, 8:49:30 AM12/27/11
to Learn C Language
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main (void)
{
int q,w,even=0,odd=0,zeros=0;
clrscr();
printf("Enter 30 Integers\n");

w=1;
while(w<=30){
scanf("%d",&q);
w++;
if(q!=0&&q%2==0){
++even;
}
else if(q%2!=0){

MUNAM NAUMAN

unread,
Dec 27, 2011, 8:52:56 AM12/27/11
to Learn C Language
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main (void)
{
int a,s,even=0,odd=0,zeros=0;
clrscr();
printf("Enter 30 Integers\n");

s=1;
while(s<=30){
scanf("%d",&a);
s++;
if(a!=0&&a%2==0){
++even;
}
else if(a%2!=0){

WAQAR ISHAQ

unread,
Dec 27, 2011, 8:58:37 AM12/27/11
to Learn C Language

MUHAMMAD FARHAN KHALID

unread,
Dec 27, 2011, 9:07:48 AM12/27/11
to Learn C Language

USMAN ARSHAD

unread,
Dec 27, 2011, 9:12:47 AM12/27/11
to Learn C Language

KASWAR ABBAS

unread,
Dec 27, 2011, 9:01:13 AM12/27/11
to Learn C Language
Reply all
Reply to author
Forward
0 new messages