100% found this document useful (1 vote)
136 views4 pages

Marvellous Logic Building Asignment - 2

Uploaded by

Saurabh Dhoke
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
100% found this document useful (1 vote)
136 views4 pages

Marvellous Logic Building Asignment - 2

Uploaded by

Saurabh Dhoke
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/ 4

Marvellous Logic Building Assignment : 2

Logic Building Assignment : 2

Complete below code snippets.


Create separate files for each application and execute it practically.
Write each program in class notebook with description.

1.Accept one number from user and print that number of * on screen.

void Display(int iNo)


{
int iCnt = 0;

for( ___; ____; ___ )


{
printf(“ * ”);
}
}

int main()
{
int iValue = 0;

printf(“Enter number”);
scanf(“____” ,&____);

Display(iValue);

return 0;
}

2. Accept one number from user and print that number of * on screen.

void Display(int iNo)


{
while( iNo > ______ )
{
printf(“ * ”);
iNo - -;
}
}

int main()
{

Piyush Khairnar - 7588945488 आ"ी Technical सं&ार करतो !!! ©Marvellous Infosystems Page 1
Marvellous Logic Building Assignment : 2

int iValue = 0;

printf(“Enter number”);
scanf(“____” ,&____);

Display(iValue);

return 0;
}

3. Accept on number from user if number is less than 10 then print


“Hello” otherwise print “Demo”.

________ Display ( ______ iNo)


{
if(______ < ____)
{
printf(“Hello”);
}
else
{
printf(“_______”);
}
}

int main()
{
int iValue = 0;

printf(“Enter number”);
scanf(“____” ,&____);

Display(iValue);

return 0;
}

4. Accept two numbers from user and display first number in second
number of times.

Input : 12 5
Output : 12 12 12 12 12

Piyush Khairnar - 7588945488 आ"ी Technical सं&ार करतो !!! ©Marvellous Infosystems Page 2
Marvellous Logic Building Assignment : 2

Input : -2 3
Output : -2 -2 -2

Input : 21 -3
Output : 21 21 21

Input : -2 0
Output :

#include<stdio.h>

______ Display( _____ iNo, int iFrequency)


{
int int = 0;

for(______; _______; ______)


{
printf(“_____”,______);
}
}

int main()
{
int iValue = 0;
int iCount = 0;

printf(“Enter number”);
scanf(“____” ,&____);

printf(“Enter frequency”);
scanf(“____” ,&____);

Display(_____, ______);

return 0;
}

5. Accept number from user and check whether number is even or


odd.

#include<stdio.h>

#define TRUE 1
#define FALSE 0

Piyush Khairnar - 7588945488 आ"ी Technical सं&ार करतो !!! ©Marvellous Infosystems Page 3
Marvellous Logic Building Assignment : 2

typedef int BOOL;

BOOL ChkEven(int iNo)


{
// Logic
}

int main()
{
int iValue = 0;
BOOL bRet = FALSE;

printf(“Enter number”);
scanf(“____” ,&____);

bRet = ChkEven(_____);

// Display result

return 0;
}

Piyush Khairnar - 7588945488 आ"ी Technical सं&ार करतो !!! ©Marvellous Infosystems Page 4

You might also like