Skip to main content

pattern problem in c with output 13579 3579 579 79 9




#include <stdio.h>

int main(void) {
    int count=1,s=0,k=1;
for(int i=1;i<=5;i++){
    for(int j=k;j<10;j++)
    {if(j%2!=0){
        if(count==2)
        s=j;
        printf("%d",j);
        count=count+1;
    }
    }
    count=1;
    k=s;
    printf("\n");
}
return 0;
}


output:-

13579                                                                                                                            
3579                                                                                                                             
579                                                                                                                              
79                                                                                                                               
9




Comments

Popular

DBMS LAB MANUAL

Programly Special's DBMS LAB MANUAL CLICK HERE TO DOWNLOAD

pattern problem in c with output 12345 4321 123 21 1

#include <stdio.h> int main(void) {     int f=5;     int w=5; for(int i=1;i<=5;i++) {     if(i%2!=0){         for(int h=1;h<=f;h++){             printf("%d",h);         }         f=f-1;         w=w-1;         printf("\n");     }     if(i%2==0){         for(int r=w;r>0;r--)         {             printf("%d",r);         }     w=w-1;     f=f-1;     printf("\n");     } } return 0; } output:- 12345                                                            ...

REAL ESTATE MANAGEMENT SYSTEM

A program known as Real Estate site Management system is designed for those who have recently joined the real estate as a consultant for distribution of sites. They recently covert the lands they have purchased into sites and in order to handle this entire process a software is developed. The main objective of this project is to highlight the requirements and to provide guidelines for the benefits of the project that is mentioned above. It also provides guidelines regarding the frame of the project that is stated above. In short, this project aims to provide a guideline for people who are involved in developing this software application. Plus, this project is a pilot project and is designed for the consultants for real estate who currently convert all the lands they have into sites. This software aims to handle the records and documents, pictures related to the sites and the informations stored in the system. This project is broad and comprehensive that can meet all the r...