Friday 27 July 2018

Print 1
Write a program to print all the numbers between a and b (a and b inclusive) using a for loop.
 
Input Format:
Input consists of 2 integers. The first integer corresponds to a and the second integer corresponds to b. Assume a>=b.
 
Output Format:
Refer Sample Input and Output for formatting specifications.
 
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output:
Enter the value of a
4
Enter the value of b
10
4
5
6
7
8
9
10
Solution:
#include<stdio.h>
int main()
{
    int a,b,i;
    printf("Enter the value of a");
    scanf("%d",&a);
    printf("\nEnter the value of b");
    scanf("%d",&b);
    
    
         for(i=a;i<=b;i++)
        {
            printf("\n%d",i);
        }
    

    return 0;
}

3 comments:

Random password generator in Java

       Random password generator in Java Source code: mport java.io.*; import java.util.*; public class Main { public static void main(Str...