includety

4
Question # 01: #include<stdio.h> #include<conio.h> void main() { intvowl=0; charch; clrscr(); while((ch=getche())!='\r') if( (ch=='a') || (ch=='A') || (ch=='e') || (ch=='E') || (ch=='i') || (ch=='I') || (ch=='o') || (ch=='O') || (ch=='u') || (ch=='U')) vowl++; printf("\n Number of Vowels are %d",vowl); getch(); } Question # 02: #include<stdio.h> #include<conio.h> void main() {

Upload: asif-khan-niazi

Post on 24-Dec-2015

212 views

Category:

Documents


0 download

DESCRIPTION

wywrt

TRANSCRIPT

Page 1: Includety

Question # 01:

#include<stdio.h>

#include<conio.h>

void main()

{

intvowl=0;

charch;

clrscr();

while((ch=getche())!='\r')

if( (ch=='a') || (ch=='A') || (ch=='e') || (ch=='E') || (ch=='i') || (ch=='I') || (ch=='o') || (ch=='O') || (ch=='u') || (ch=='U'))

vowl++;

printf("\n Number of Vowels are %d",vowl);

getch();

}

Question # 02:

#include<stdio.h>

#include<conio.h>

void main()

{

intx,y,c=0,sum=0,tn=0;

floatavg=0;

clrscr();

Page 2: Includety

for(x=2;x<=100;x++)

{

for(y=x;y>=2;y--)

{

if(x%y==0)

c++; }

if(c==1)

{

printf(" %d",x);

tn++;

sum=sum+x;

}

c=0;

}

avg=sum/tn;

printf("\n The average of these prime numbe is: %f",avg);

getch();}

Question # 03:

#include<stdio.h>

#include<conio.h>

void main()

Page 3: Includety

if(ch==’S’)

continue;

printf(“%c”,ch1);

}

printf(“\n”);

m=m-4;

}

getch();

}

Page 4: Includety

DATE: 23-01-2015