Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

Assignment

(Electrical Engineering)

COMPUTING FUNDAMENTALS
BEE 2-A

By Muhammad Usman
01-133102-064

Department of Engineering

Bahria University, Islamabad Campus

Submitted To:
DR.SHEZAD
1ST PROGRAM TEMPARATURE CONVERTOR:

#include<iostream.h>

#include<conio.h>

void main()

{ clrscr();

int temperature;

cout<<"enter temperature ";

cin>>temperature;

cout<<"temperature in farenheit is="<<(temperature)*9/5+32;

getch();

}
2ND PROGRAM STARS:

#include<iostream.h>
#include<conio.h>
void main()

{ clrscr();
int space=4,star=1;
for (int a=0;a<5;a++)
{
for(int c=0;c<space;c++)
cout<<" ";
space--;
for(int g=0;g<star;g++)
cout<<"*";
cout<<"\n";
star=star+2;

space=1,star=7;
for(a=0;a<4;a++)
{
for(int c=0;c<space;c++)
cout<<" ";
space++;
for(int g=0;g<star;g++)
cout<<"*";
cout<<"\n";
star=star-2;}

getch();

}
3RD PROGRAM MERIT :

#include<iostream.h>

#include<conio.h>

void main()

{ clrscr();

double a,b,c;

cout<<"Intermediate marks obtained";

cin>>a;

cout<<"total marks";

cin>>b;

cout<<"enter marks in entry test";

cin>>c;

cout<<"your merit is="<<(a/b)*60+(c/100)*40;

getch();

}
4TH PROGRAM ADDING DIGGETS :

#include<iostream.h>

#include<conio.h>

void main()

{clrscr();

int z,x,c,v,b,n,m;

cout<<"enter a four digit number ";

cin>>z;

x=z/1000;

c=z/100;

v=c%10;

b=z/10;

n=b%10;

m=z%10;

cout<<"the result is= "<<x+v+n+m;

getch();

You might also like