You are on page 1of 5

COMPUTER SCIENCE ENGINEERING

ASSIGNMENT NO.1

SUBMITTED TO: MISS GAGANDEEP KAUR

COURSE TITLE: FOUNDATIONS OF COMPUTING

COURSE CODE: CSE101

SUBMITTED BY: PRANEET SINGH

ROLL NO.:RB5004A81

SECTION: B5004

REGISTRATION NO.: 11012571

PROGRAM: B.TECH –CE


PART-A

Ans 1:- a)start

b)input 10 four digit numbers a,b,c,d,e,f,g,h,i,j

c)sum = a+b+c+d+e+f+g+h+i+j

d)print sum

e)stop

Ans2:-

Start

input 10 four
digit numbers
a,b, c ,d,e, f , g ,h, i , j

sum=a+b+ c +d+e
+ f + g +h+ i + j

true
if sum>1000
or
sum= o

false

print"zero is the true


only possibility if sum<0
here"

false

print"enter
if sum is any true valid data
special
again"
character

false

print"sum"

end

Ans 3:- BEGIN

INPUT a,b,c,d,e,f,g,h,i,j

SUM=a+b+c+d+e+f+g+h+i+j
IF SUM>1000

IF SUM=0

PRINT:INPUT DATA AGAIN

IF SUM<0

PRINT:ZERO IS THE ONLY POSSIBILITY HERE

IF SUM =CHAR

PRINT:ENTER VALID DATA

ELSE

PRINT:SUM

END IF

Ans 4:-

#include<stdio.h>

#include<conio.h>

Void main()

Int a,b,c,d,n,sum=0;

Clrscr();

Printf(“enter the value of a,b,c,d”)

Scanf(“%d%d%d%d”,&a,&b,&c,&d);

n= a*1000+b*100+c*10+d*1;

printf(“The four digit number =%d”,n);

sum=b+c;

printf(“the sum of second and third integer=%d”,sum);

getch();

}
Ans 5:-

#include<stdio.h>

#include<conio.h>

Void main()

Int a,b;

Clrscr();

Printf(“enter the value ”);

Scanf(“%d%d”,&a,&b);

a =a+b;

b =a-b;

a =a-b;

printf(“a=%d \nb=%d”,a,b);

getch();

Ans 6:-

#include<stdio.h>

#include<conio.h>

Void main()

Int n,

Clrscr();

Printf(“Enter the value of n”);

Scanf(“%d”,&n);

Printf(“2*%d-%d=%d\n2*%d/2=%d\n%d*1=%d\n%d+0=%d”,n);

Getch();

You might also like