Category: snippet

Two Digits Numbers Sum

                            Two Digits Numbers Sum   Accept an array of N values and print the sum S of all the two digit numbers present in the array. If there are no two digit numbers, print 0. Input Format: First line contains the

Right Angled Triangle Check

                      Right Angled Triangle Check                                                   The length of the three sides of a triangle A, B and C are passed

Peak Elements Count

                           Peak Elements Count N integers are passed as input. The program must print the count of peak elements among the N integers. An element is a peak element if it is greater than it's neighbours (the elements to the left and right).The

Rounding Marks

                              Rounding Marks In a college, each student receives marks M in any of the subjects in the range from 0 to 100. - If the difference between the marks and the next multiple of 5 is less than 3, then

Sum of the Matrix- using Pointers

                                                Matrix Sum- Using Pointers #include<stdio.h>#include<stdlib.h> int ** createMatrix(int,int);void readMatrix(int **, int, int);int findSum(int **, int, int);int main() {    int m,n;    //printf("Enter Rows");    scanf("%d",&m);    //printf("Enter Columns");    scanf("%d",&n);   

Patterns- Efficient Methodologies

                      BASIC PATTERN LOGIC PATTERN ** ** * ** * * ** * * * * Program(Method 1):#include <stdio.h>void main()({   int i,j,n;   printf("Enter the Number of lines:");   scanf("%d",&n);   for(i=1;i<=n;i++)   {    for(j=1;j<=i;j++)        printf("%s","*");    printf("n");   }}Program(Method 2 – Best Method): #include <stdio.h>void

Pattern Challange

You need to take an integer input and then draw the pattern according to it. Say for example if you enter 5 then, the pattern should be like this-             1          1 2       1 2 3    1 2 3 4 1 2 3 4 5 Input Format: You will take an integer input from stdin and the range of

Reversing the string without changing the Special character positions

Reversing the string without changing the Special character positions Example : i/p :      abcd#1234 o/p :      dcba#4321Code:import java.util.*;class Hello {     public static void main(String args) { Scanner sc=new Scanner(; String str=sc.nextLine();        String ch=str.split("\W");        String sp=str.split("[a-zA-Z0-9]");        int i=0,len=0;        try{   

New Magician

New Magician You are a programming-savvy person and you never get involved in any extra-curricular activities. Your faculty mentor has ordered that you need to give one on-stage performance in the Induction Program for the first years to be held a week later. You were very tensed thinking about it and you could hardly sleep.

Snake and Ladder

Snake and Ladder                                The game of Snakes and Ladder is played by two or more players who take turns rolling a dice. There is usually 1 dice but more than 1 can also be used. The board is a 10