Join Regular Classroom : Visit ClassroomTech

Capgemini Pseudocode Solved | Set 4 – codewindow.in

Function fun(){
Input num=40
Return num--
}
Function main()
{
for(fun() ; fun() ; fun()) {
print fun();
}
Function main()
char *s[] = { "knowledge","is","power"} char **p
p = s print
++*pprint
*p++print
++*p
for X=5 to 1
for Y=1 to X
print Y
Function foo(int* a, int* b)
sum = *a + *b
*b = *a
RETURN *a = sum - *b
Function main()
int i = 0, j = 1, k = 2, l; l = i++ OR
foo(&j, &k) print(i, j, k, l)
Read
count=5 Set x to
0; While(x <
count)
Set even to even +
2x = x + 1
write even
begin
q := 0 // q is going to contain floor(x/y)
r := x // r is going to contain x % y

// Repeatedly subtract y from x.
while r >= y do
begin
r := r – y
q := q + 1
end
end
READ m = 10
Initialize n & n1
n = m++
n1 = ++m
n--
--n1
n -= n1
Write n
Function f(int* p, int m)
m = m - 5
*p = *p - m
return;
EndFunction

Function main()
Input i=10, j=5
f(&i, j)
print i+j
Function main()
Input ch
Write”Enter value between 1 to 2:”
Read ch
switch(ch,ch+1)
Case 1:
50.
Function f(int* p, int m)
m = m - 5
*p = *p - m
return;
EndFunction

Function main()
Input i=10, j=5
f(&i, j)
print i+j

Write “1”
Case 2:
Write “2”
break
Default:
Write “3”
input num=134
Function fun1(int num)
Static int a=0
If(num>0)
a=a+1
fun1(num/10)
else
return a
n=2
int fun(int n)
if(n equals 5)
return n
else
return 2*fun(n+1)
IF LOC=-1 do ITEM NOT
FOUNDDo_(DATA,N,ITEM,LOC)
Initialize counter set LOC=0,LOW=0,HI=N-1
[Search for item]Repeat while LOW<=HI
MID=(LOW+HI)/2
IF ITEM=DATA[MID]
do2.3LOC=MID
Return LOC
IF ITEM<DATA[MID]
HI=MID-1

ELSE
LOW=MID+1

Also Checkout

Recent Posts
Categories
Pages