0% found this document useful (0 votes)
42 views16 pages

Comuter Fundamentals

This document contains code submissions and outputs for 7 computer fundamentals tasks completed by Abdul Ahad Anwar with a roll number of 01 for his BSME 14-18 course. Each task section includes the name, roll number, task number, date, code submission, and output. The tasks involve printing information, loops, input/output, and validation of user input.

Uploaded by

Abdul Ahad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views16 pages

Comuter Fundamentals

This document contains code submissions and outputs for 7 computer fundamentals tasks completed by Abdul Ahad Anwar with a roll number of 01 for his BSME 14-18 course. Each task section includes the name, roll number, task number, date, code submission, and output. The tasks involve printing information, loops, input/output, and validation of user input.

Uploaded by

Abdul Ahad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

COMUTER FUNDAMENTALS (LABS)

SUBMITTED BY: ABDUL AHAD ANWAR


ROLL # : 01
BSME 14-18

SUBMITTED TO:Mr. NAUMAN SHAMM

TASK: 01
CODE
#include <stdio.h>
#include <conio.h>
int main(){
printf("Name :\tABDUL AHAD\nRollno :\t01\nTask :\t1\nDate :\tMarch-09-2016");
signed int a,b;
printf("\nenter smaller no:");
scanf("%d",&a);
printf("\nenter greater no:");
scanf("%d",&b);
if(a<b)
for( ;a<=b;a++)
printf("%d\n",a);
getch();
}

OUTPUT

TASK: 02
CODE
#include <stdio.h>
#include <conio.h>
int main(){
printf("Name :\TABDUL AHAD\nRollno :\t01\nTask :\t02\nDate :\tMarch-09-2016");
int a,b,c;
printf("\nenter first no:");
scanf("%d",&a);
printf("\nenter second no:");
scanf("%d",&b);
if(a>b){
c=a;
a=b;
b=c;}
for( ;a<=b;a++)
printf("\t%d\t",a);
getch();
}

OUTPUT

TASK:03
CODE

#include <stdio.h>
#include <conio.h>
int main(){
printf("Name :\TABDUL AHAD \nRollno :\t01\nTask :\t03\nDate :\tMarch-09-2016");
int a,b,c;
printf("\nenter first no:");
scanf("%d",&a);
printf("\nenter second no:");
scanf("%d",&b);
if(a>b){
c=a;
a=b;
b=c;}
for( ;a<=b;a++)
if(a%2==0)
printf("\t%d\t",a);
getch();
}

OUTPUT

TASK 04
CODE
#include<stdio.h>

#include<conio.h>
void main()
{
printf("\nName : ABDUL AHD");
printf("\nRoll#: 01");
printf("\nTask#: 04");
printf("\nDate : March-09-2016");
printf("\n\n---------------Task ouput-----------------\n\n");
int b=0,i=1,num;
printf("Enter value of a number:");
scanf("%d",&num);
printf("\nThe series is:\n");
for (i=1;i<=num;i++)
{b=2*b+1;
printf("%d ",b);}
getch();
}

OUTPUT

TASK:05
CODE
#include<stdio.h>
#include<conio.h>
void main()
{
printf("\nName : ABDUL AHAD");
printf("\nRoll#: 01 ");
printf("\nTask#: 05");
printf("\nDate : March-09-2016");
printf("\n\n

Task 5 ouput \n\n");

int i,num;
for (i=1;i<=5;i++)
{
printf("Enter a number :");
scanf("%d",&num);
if (num%2==0)
printf("Status : Even\n");
else
printf("Status : Odd\n");
}
getch();}

OUTPUT

TASK:06
CODE
#include<stdio.h>

#include<conio.h>
void main()
{
printf("\nName : ABDUL AHAD");
printf("\nRoll#: 01");
printf("\nTask#: 06");
printf("\nDate : March-09-2016");
printf("\n\n---------------Task ouput-----------------\n\n");
int i,num,evencount=0,oddcount=0;
for (i=1;i<=5;i++)
{
printf("Enter a number :");
scanf("%d",&num);
if (num%2==0)
{printf("Status : Even\n");
evencount=evencount+1;}
else
{printf("Status : Odd\n");
oddcount=oddcount+1;}
}
printf("\nEven numbers = %d\n",evencount);
printf("Odd numbers = %d",oddcount);
getch();
}

OUTPUT

TASK: 07
CODE

#include<conio.h>
void main()
{
printf("\nName : ABDUL AHAD");
printf("\nRoll#: 01");
printf("\nTask#: 06");
printf("\nDate : March-09-2016");
printf("\n\n---------------Task ouput-----------------\n\n");
int i,num;
for(i=0;i<1;i=i)
{
printf("\nenter a number between 1 and 10: ");
scanf("%d",&num);
if(num<=1 || num>=10){
i=0;
printf("The number you have entered does not fit the required
parameters");
}
else
{
i=1;
printf("number is valid");

}
}

getch();
}

OUTPUT

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy