continue or break statement Get link Facebook X Pinterest Email Other Apps August 28, 2020 #include <stdio.h>int main(){int i ;for ( i = 1 ; i<= 10 ; i++ ) { if ( i ==5) //break; continue ; printf(" %d ------- Hello World \n" , i);} return 0;} Get link Facebook X Pinterest Email Other Apps Comments
Right angle triangle pattern October 31, 2020 #include <stdio.h> int main () { int num, row , columb; printf("Enter the number of row : "); scanf("%d", &num); for (row = 1 ; row <= num; row++){ for (columb =1 ; columb <= row; columb++){ printf("*"); } printf("\n"); } return 0 ;} Read more
Toggle the character October 30, 2020 /* stdin is input standard input */ #include <stdio.h> #include <stdlib.h> #define SIZE 30 int main (){ char text[SIZE]; int index; printf("please enter the string Value\n"); fgets(text, SIZE, stdin); printf("enter string is %s \n", text); for(index = 0; text[index] != '\0'; index++) { if(text[index] >= 'A' && text[index] <= 'Z' ) text[index]=text[index]+32; else if (text[index] >= 'a' && text[index] <= 'z' ) text[index]=text[index]-32; }printf("string value after toggle is %s\n", text); return 0 ; } Read more
Right angle Floyd's triangle November 02, 2020 #include <stdio.h> int main (){ int totalrow=9, row , colomb; for (row = 1 ; row <= totalrow; row++){ for (colomb =1 ; colomb <= row; colomb++){ //printf("%d ", row); printf("%d ", colomb); } printf("\n"); } return 0; } Read more
Comments
Post a Comment