31/03/2020
Learn C/Q-Basic/Python/HTML/CSS
We provides you better knowledge about programming
31/03/2020
What is the output if we give 396 as input?
int main()
{
int years,month,days,x,y;
printf("Enter the number of days:");
scanf("%d",&days);
years=days/365;
x=days%365;
month=x/30;
y=x%30;
printf("Years:%d \n Months:%d \n Days:%d",years,month,y);
}
//*Program to print middle number.
main()
{
int a,b,c;
printf("enter three numbers:");
scanf("%d,%d,%d",&a,&b,&c);
if(a>b&&aa&&b
GUESS THE OUTPUT
int main()
{
int a=1,b=10,v;
printf("Require pattern is:");
for(v=1;v
//*WAP to print multiplication table of input number
main()
{
int a,b=1,c;
printf("enter number for table:");
scanf("%d",&a);
do
{
c=a*b;
printf("%d x %d=%d\n",a,b,c);
b++;
}
while(b
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
int main()
{
int a=1,i,j;
printf("\n");
for(i=1;i
24/01/2020
Simple example on working with string in python:
1) M
HMA
THMAN
ATHMAND
KATHMANDU
pattarn printing in qBasic.
CLS
A$ = "KATHMANDU"
B = 1
C = 35
FOR I = 5 TO 1 STEP -1
PRINT TAB(C); MID$(A$, I, B)
B = B + 2
C = C - 1
NEXT I
END
23/01/2020
A simple python program using classes and objects :
3)Wap to check the input number is amstrong or not
main()
{
int a,b,c,d=0;
printf("Enter Any Number:");
scanf("%d",&a);
b=a;
while(a!=0)
{
c=a%10;
d=d+(c*c*c);
a/=10;
}
if(d==b)
printf("Amstrong");
else
printf("Not Amstrong");
}
2)wap to print 0 1 1 2 3......up to nth term.
main()
{
int n,a=0,b=1,c,i;
printf("Enter the series:");
scanf("%d",&n);
printf("The series are\t");
printf("%d\t%d",a,b);
for(i=0;i
Click here to claim your Sponsored Listing.
Location
Category
Contact the school
Telephone
Website
Address
Bharatpur