include.docx

Post on 25-Dec-2015

212 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Question # 01:

#include<stdio.h>

#include<conio.h>

void main()

{

int vowl=0;

char ch;

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()

{

int x,y,c=0,sum=0,tn=0;

float avg=0;

clrscr();

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()

if(ch==’S’)

continue;

printf(“%c”,ch1);

}

printf(“\n”);

m=m-4;

}

getch();

}

ASSIGNMENT # 02

SUBMITTED BY:

Muhammad Asif Khan

ROLL NUMBER:

Z-34

COURSE:

Computing skill

BATCH:

MS22

SUBMITTED TO:

DR. ADEEL ABBAS

DATE: 23-01-2015

top related