DisplayMonth( int month ) //base 0
{
switch( month )
{
case 0: printf("January\n"); break;
case 1: printf("February\n"); break;
case 2: printf("March\n"); break;
.... and so on
}
}
enjoy
#include
#include
main()
{
int dd,mm,yy,odday,n,ly,ny,i;
int a[12]={3,0,3,2,3,2,3,3,2,3,2,3};/* odd days according to months in a year
clrscr();
printf("Enter a date in DD/MM/YY format
");
printf("DATE: ");
scanf("%d",&dd);
printf("MONTH: ");
scanf("%d",&mm);
printf("YEAR: ");
scanf("%d",&yy);
printf("Day ON %d / %d / %d is : ",dd,mm,yy);
n=((yy-1)%400);
ly=n/4;
ny= n-ly;
odday=(ly*2)+ny;
if(yy%4==0)
{
a[2]=1;
}
for(i=1;i
Using standing input techniques of the language, get the month number as a number (and not a string) and check it is an integer in the required range. Then to convert it to number of days, either use a look up table or a formula on the month number. Finally use the standard output techniques of the language to display the result.
Of course, with the given input, the program will have a problem with February as it may have 28 or 29 days depending upon whether it is a leap year or not and no year is requested for consideration.
Design a program that asks the user to enter the number of books that he or she has purchased last month and display the number of points awarded?
with a computer.
march
identification division. program-id. greatest. environment division. data division. working-storage section. 77 a pic 999. 77 b pic 999. 77 c pic 999. procedure division. greatest. display "ENTER THE THREE NUMBERS:". accept a. accept b. accept c. if a > b and a > c display a "is greatest" else if b > c display b "is greatest" else display c "is greatest". display " thank you". stop run.
draw a flowchart to display the first tenth even number
The scanf() function is a commonly used function to input information during the execution of a program. scanf() function has its prototype in the stdio.h header file. To accept and display a number: int num; printf("Enter a number: "); scanf("%d",&num); printf("You entered %d",num); To accept and display a character, replace %d with %c and make num a character variable [char]. Plus: gets, fgets, read, fread, getchar, getc, fgetc, getch...
seq 1 2 99
program that take three decimal number as input and find the largest among them in assembly language
identification division. program-id. greatest. environment division. data division. working-storage section. 77 a pic 999. 77 b pic 999. 77 c pic 999. procedure division. greatest. display "ENTER THE THREE NUMBERS:". accept a. accept b. accept c. if a > b and a > c display a "is greatest" else if b > c display b "is greatest" else display c "is greatest". display " thank you". stop run.
draw a flowchart to display the first tenth even number
Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.
20
no
write a program to display your name age class schoolname e-mail 2hobby based on choice
Start accept 7 number calculate sum print sum stop
The scanf() function is a commonly used function to input information during the execution of a program. scanf() function has its prototype in the stdio.h header file. To accept and display a number: int num; printf("Enter a number: "); scanf("%d",&num); printf("You entered %d",num); To accept and display a character, replace %d with %c and make num a character variable [char]. Plus: gets, fgets, read, fread, getchar, getc, fgetc, getch...
The program is here guys.......... //Finding whether the given number is perfect or not //Starts here #include<stdio.h> void main() { int i=1,temp=0,number; scanf("%d",&number); while(i<=number/2){ if(number%i==0) temp+=i; i++; } if(temp==number) printf("Its a perfect number"); else printf("Its not a perfect number"); } //ends here
write a c program to accept a number and generate a square root cube and exponential values
/* a number divisible by x should be a multiple of x */ int i, n,x; scanf ("%d", &n); scanf ("%d",&x); for(i=x;i =< n;i+=x) { printf ("%d", x); }
seq 1 2 99