int maxprod (int n) { return n/2; } int main (void) { int n, a, b; n= 7; /* for example */ a= maxprod (n); b= n-a; printf ("%d+%d=%d, %d*%d=%d\n", a, b, a+b, a, b, a*b); }
//here is a simple implementation of leaky bucket. #include<stdio.h> #include<stdlib.h> #include<dos.h> void main() { int i,packets[10],content=0,newcontent,time,clk,bcktsize,oprate; for(i=0;i<5;i++) { packets[i]=rand()%10; if(packets[i]==0) --i; } printf("\n Enter output rate of the bucket: \n"); scanf("%d",&oprate); printf("\n Enter Bucketsize\n"); scanf("%d",&bcktsize); for(i=0;i<5;++i) { if((packets[i]+content)>bcktsize) { if(packets[i]>bcktsize) printf("\n Incoming packet size %d greater than the size of the bucket\n",packets[i]); else printf("\n bucket size exceeded\n"); } else { newcontent=packets[i]; content+=newcontent; printf("\n Incoming Packet : %d\n",newcontent); printf("\n Transmission left : %d\n",content); time=rand()%10; printf("\n Next packet will come at %d\n",time); for(clk=0;clk<time && content>0;++clk) { printf("\n Left time %d",(time-clk)); sleep(1); if(content) { printf("\n Transmitted\n"); if(content<oprate) content=0; else content=content-oprate; printf("\n Bytes remaining : %d\n",content); } else printf("\n No packets to send\n"); } } } }
#include void main() { int i=2,m,n; printf("enter number"); scanf("%d",&n); do { m=i*n; printf("%d*%d=%d\n",n,i,m); i=i+1; } while (i<=10); }
/*mycfiles.wordpress.com Program to prepare Table of any no. using while loop*/ #include #include void main() { int n,t,count=1; clrscr(); printf("Enter any number\n\n"); scanf("%d",&n); while(count<=10) { t=n*count; printf("\n%d*%d=%d",n,count,t); count++; } getch(); }
#include <stdio.h> #include<string.h> main() { char s[80]; int d; clrscr(); printf("enter the month of your birthday: "); gets(s); if(!(strcmp(s, "january"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=19) printf("\n CAPRICORN"); else printf("\n AQUARIUS"); } if(!(strcmp(s, "february"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=18) printf("\n AQUARIUS"); else printf("\n PISCES"); } if(!(strcmp(s, "march"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=20) printf("\n PISCES"); else printf("\n ARIES"); } if(!(strcmp(s, "april"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=19) printf("\n ARIES"); else printf("\n TAURUS"); } if(!(strcmp(s, "may"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=20) printf("\n TAURUS"); else printf("\n GEMINI"); } if(!(strcmp(s, "june"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=20) printf("\n GEMINI"); else printf("\n CANCER"); } if(!(strcmp(s, "july"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=22) printf("\n CANCER"); else printf("\n LEO"); } if(!(strcmp(s, "august"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=22) printf("\n LEO"); else printf("\n VIRGO"); } if(!(strcmp(s, "september"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=22) printf("\n VIRGO"); else printf("\n LIBRA"); } if(!(strcmp(s, "october"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=22) printf("\n LIBRA"); else printf("\n SCORPIO"); } if(!(strcmp(s, "november"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=21) printf("\n SCORPIO"); else printf("\n SAGITTARIUS"); } if(!(strcmp(s, "december"))) { printf("\n enter the date of your birthday: "); scanf("%i", &d); if(d<=21) printf("\n SAGITTARIUS"); else printf("\n CAPRICORN"); } getch(); }
What time does Macy s open today and close d
If the amount being added each time is d and if the first term is a, then t(n) = a + (n-1)*d
The time may vary from store to store, but generally, Captain D's closes at 11 p.m.
Linksys N routers give great range on the 5.4 Ghz. band, but D-link comes in a close second.
What time does Macy s open today and close d
printf ("square of %d is %d\n", $n, $n*$n);
Suppose the number is n/d. Then n/d >= d => n <= d2 if d < 0 or n >= d2 if d > 0.
5 Σ (3n + 5) n=1 is the sum of the first five terms of the sequence 8, 11, 14, ... which is: sum = 5/2(8 + 20) = 70 The sum of the arithmetic sequence of n terms with first term a and common difference d, ie a, a+d, a+2d, a+3d, .., a+(n-1)d, is given by: sum = number_of_terms/2(first_term + last_term) = n/2(a + a+(n-1)d) = n/2(2a + (n-1)d)
E N G L A N D
12=n in a d
rate = distance / time (r= d/t)
I: i d: do not n: know