//Program for Interest calculation using the concept of default arguments #include<iostream.h> #include<conio.h> void main() { float amount, principal; int time; float interest(float p, int n, float r=0.15); cout<<"Program for simple interest calculation"<<endl; cout<<"Please enter principal amount:"; cin>>principal; cout<<"Please enter Time: "; cin>>time; amount=interest(principal, time); cout<<"\nThe amount is:"<<amount; cout<<"\nPress any key to continue..."; getch(); } float interest(float p, int n,float r) { return (p+((p*r*n)/100.0)); }
Data Communication Terminologies There are several common terminologies used in data communication literature: Channel: The word channel refers to the portion of a link that carries a transmission between a given pair of lines. One link can have many (n) channels. Data Rate: The data rate defines the number data elements (bits) sent in 1 second. The unit is bits per second (bps). Signal Rate: The signal rate is the numbers of signal elements sent in 1 second. The unit is baud . The data rate is sometimes called the bit rate : the signal rate is sometimes called the pulse rate, the modulation rate, or the baud rate. One goal in data communications is to increase the data rate while decreasing the signal rate. Increasing the data rate increases the speed of transmission; deceasing the signal rate decreasing the bandwidth requirement. Bandwidth: Bandwidth can be used in two different contexts with two different measuring values:- Bandwidth in Hertz: Bandwidth in ...
Palindrome means a number which remains same if positions of its digits is reversed i.e., 1221 #include<stdio.h> #include<conio.h> void main() { int n,digit,rev=0,num; printf("enter the number"); scanf("%d",&num); n=num; do { digit=num%10; rev=rev*10+digit; num/=10; }while(num!=0); printf("reverse number is=%d\n",rev); if(n==rev) { printf("number is palindrome"); } else { printf("number is not palindrome") ; } getch(); }
Comments
Post a Comment