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
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
You can use the following C program to display "1" if a user enters any non-zero number, and "0" if the entered number is zero: #include <stdio.h> int main() { int num; printf("Enter a number: "); scanf("%d", &num); if (num != 0) { printf("1\n"); } else { printf("0\n"); } return 0; } This program reads an integer from the user and checks if it is non-zero or zero, then prints the corresponding output.
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
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 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
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...
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
Simply use a for loop (i) that runs from 2 to N-1. Checking if N % i 0 then its a prime number.